def upload(self, params={}):
if self.upload_token is not None:<EOL><INDENT>status = self.check()<EOL>if status['<STR_LIT:status>'] != <NUM_LIT:4>:<EOL><INDENT>return self.commit()<EOL><DEDENT>else:<EOL><INDENT>self.new_slice()<EOL>while self.slice_task_id != <NUM_LIT:0>:<EOL><INDENT>self.upload_slice()<EOL><DEDENT>return self.commit()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.create(self.prepare_video_params(**params))<EOL>self.create_file()<EOL>self.new_slice()<EOL>while self.slice_task_id != <NUM_LIT:0>:<EOL><INDENT>self.upload_slice()<EOL><DEDENT>return self.commit()<EOL><DEDENT>
start uploading the file until upload is complete or error.
           This is the main method to used, If you do not care about
           state of process.

           Args:
                params: a dict object describe video info, eg title,
                tags, description, category.
                all video params see the doc of prepare_video_params.

           Returns:
                return video_id if upload successfully