|
@@ -137,10 +137,9 @@ class VideoStitching():
|
|
|
|
|
|
# 新生成视频上传到对应账号下
|
|
|
@classmethod
|
|
|
- def insert_piaoquantv(cls, oss_object_key, title_list, video_type, channel_type):
|
|
|
+ def insert_piaoquantv(cls, oss_object_key, title, video_type, channel_type):
|
|
|
#list = ["66481136", "66481137", "66481140", "66481141", "66481142"] 老用户id
|
|
|
if video_type == "自制--春节":
|
|
|
- title = title_list
|
|
|
list = ['15924999', '50322241', '50322258', '57463797', '50322235', '57463790', '50322234', '6605563', '18981907', '50322198', '50322239', '57463838', '14500202']
|
|
|
code = 1
|
|
|
for i in range(len(list)):
|
|
@@ -192,8 +191,6 @@ class VideoStitching():
|
|
|
code = 1
|
|
|
for i in range(2):
|
|
|
item = random.choice(list)
|
|
|
- title_list = [item for item in title_list if item is not None]
|
|
|
- title = random.choice(title_list)
|
|
|
# title = title[0].strip("[]'")
|
|
|
url = "https://vlogapi.piaoquantv.com/longvideoapi/crawler/video/send"
|
|
|
payload = dict(pageSource='vlog-pages/post/post-video-post', videoPath=oss_object_key, width='720',
|
|
@@ -388,8 +385,9 @@ class VideoStitching():
|
|
|
Feishu.bot('recommend', '管理后台', '管理后台cookie失效,请及时更换~')
|
|
|
return ""
|
|
|
audio_url = data["content"]["transedVideoPath"]
|
|
|
+ audio_title = data["content"]['title']
|
|
|
print(audio_url)
|
|
|
- return audio_url
|
|
|
+ return audio_url, audio_title
|
|
|
except Exception as e:
|
|
|
Common.logger("video").warning(f"获取音频视频链接失败:{e}\n")
|
|
|
return ""
|
|
@@ -403,7 +401,7 @@ class VideoStitching():
|
|
|
if audio_id == None:
|
|
|
Common.logger("video").info(f"获取音频url为空")
|
|
|
return
|
|
|
- audio = cls.get_audio_url(audio_id)
|
|
|
+ audio, audio_title = cls.get_audio_url(audio_id)
|
|
|
if audio == "":
|
|
|
Common.logger("video").info(f"获取音频地址为空")
|
|
|
return
|
|
@@ -476,7 +474,7 @@ class VideoStitching():
|
|
|
for video in videos:
|
|
|
filename = video[2].split("/")[-1]
|
|
|
os.remove(f'./video_stitching/video_material/{filename}.mp4')
|
|
|
- piaoquantv = cls.insert_piaoquantv(oss_object_key, title_list, video_type, channel_type)
|
|
|
+ piaoquantv = cls.insert_piaoquantv(oss_object_key, audio_title, video_type, channel_type)
|
|
|
if piaoquantv:
|
|
|
Common.logger("video").info(f"视频添加到对应用户成功")
|
|
|
# 关闭视频文件
|