@@ -80,20 +80,24 @@ def publish_video(self, file):
8080 if publish_video_response ['code' ] == 0 :
8181 bvid = publish_video_response ['data' ]['bvid' ]
8282 self .logger .info (f'upload success!\t bvid:{ bvid } ' )
83+ return True
8384 else :
8485 self .logger .error (publish_video_response ['message' ])
86+ return False
8587 # reset the video title
8688 Model ().reset_upload_config ()
8789
88- def append_video_entry (self , video_path , bvid ):
90+ def append_video_entry (self , video_path , bvid , video_name = None ):
8991 bilibili_filename = self .upload_video (video_path )
90- video_name = Path (video_path ).name .strip (".mp4" )
92+ video_name = video_name if video_name else Path (video_path ).name .strip (".mp4" )
9193 video_data = self .bili_uploader .get_video_list_info (bvid )
9294 response = self .bili_uploader .append_video (bilibili_filename , video_name , video_data )
9395 if response ['code' ] == 0 :
9496 self .logger .info (f'append { video_name } to { bvid } success!' )
97+ return True
9598 else :
9699 self .logger .error (response ['message' ])
100+ return False
97101 # reset the video title
98102 Model ().reset_upload_config ()
99103
@@ -107,5 +111,5 @@ def upload_video_entry(self, video_path, yaml, copyright, tid, title, desc, tag,
107111 desc , tag , source , cover , dynamic
108112 )
109113 Model ().update_multiple_config ('upload' , upload_metadata )
110- self .publish_video (video_path )
114+ return self .publish_video (video_path )
111115
0 commit comments