def upload(self, parts, copyright: int, title: str, tid: int, tag: str, desc: str, source: str = '', cover: str = '', no_reprint: int = 0, open_elec: int = 1, max_retry: int = 5, thread_pool_workers: int = 1): return core.upload(self.access_token, self.sid, self.mid, parts, copyright, title, tid, tag, desc, source, cover, no_reprint, open_elec, max_retry, thread_pool_workers)
def finishUpload( self, title, tid, tag, desc, source='', cover='', no_reprint=1, ): """ :param title: video's title :type title: str :param tid: video type, see: https://member.bilibili.com/x/web/archive/pre or https://github.com/uupers/BiliSpider/wiki/%E8%A7%86%E9%A2%91%E5%88%86%E5%8C%BA%E5%AF%B9%E5%BA%94%E8%A1%A8 :type tid: int :param tag: video's tag :type tag: list<str> :param desc: video's description :type desc: str :param source: (optional) 转载地址 :type source: str :param cover: (optional) cover's URL, use method *cover_up* to get :type cover: str :param no_reprint: (optional) 0=可以转载, 1=禁止转载(default) :type no_reprint: int :param copyright: (optional) 0=转载的, 1=自制的(default) :type copyright: int """ from Common import appendUploadStatus, modifyLastUploadStatus, appendError if len(self.parts) == 0: return appendUploadStatus("[{}]投稿中,请稍后".format(title)) copyright = 2 if source else 1 try: avid, bvid = core.upload(self.access_token, self.session_id, self.user_id, self.parts, copyright, title=title, tid=tid, tag=','.join(tag), desc=desc, source=source, cover=cover, no_reprint=no_reprint) modifyLastUploadStatus("[{}]投稿成功;AVID【{}】,BVID【{}】".format( title, avid, bvid)) self.clear() except Exception as e: modifyLastUploadStatus("[{}]投稿失败".format(title)) appendError(e)