|
@@ -85,6 +85,15 @@ class VideoProcessor:
|
|
|
video_ending = task["video_ending"]
|
|
|
crop_total = task["crop_total"]
|
|
|
gg_duration_total = task["gg_duration_total"]
|
|
|
+ voice = task['voice']
|
|
|
+ if voice:
|
|
|
+ if ',' in voice:
|
|
|
+ voices = voice.split(',')
|
|
|
+ else:
|
|
|
+ voices = [voice]
|
|
|
+ voice = random.choice(voices)
|
|
|
+ else:
|
|
|
+ voice = "zhifeng_emo"
|
|
|
video_path_url = cls.create_folders(mark, str(task_mark))
|
|
|
zm = Material.get_pzsrt_data("summary", "500Oe0", video_share)
|
|
|
Common.logger(mark).info(f"{name}的{task_mark}下{channel_id}的用户:{url}开始获取视频")
|
|
@@ -148,7 +157,7 @@ class VideoProcessor:
|
|
|
continue
|
|
|
if new_video_path:
|
|
|
if video_ending and video_ending != 'None':
|
|
|
- new_video_path = cls.handle_video_ending(new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm)
|
|
|
+ new_video_path = cls.handle_video_ending(new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm, voice)
|
|
|
else:
|
|
|
if video_share and video_share != 'None':
|
|
|
new_video_path = FFmpeg.single_video(new_video_path, video_path_url, zm)
|
|
@@ -199,13 +208,14 @@ class VideoProcessor:
|
|
|
f"**渠道**: {channel_id}\n"
|
|
|
f"**视频主页ID**: {url}\n"
|
|
|
f"**视频Video_id**: {v_id}\n"
|
|
|
+ f"**使用音频音色**: {voice}\n"
|
|
|
)
|
|
|
|
|
|
|
|
|
Feishu.finish_bot(text,
|
|
|
"https://open.feishu.cn/open-apis/bot/v2/hook/e7697dc6-5254-4411-8b59-3cd0742bf703",
|
|
|
"【 机器改造通知 】")
|
|
|
- log_data = f"user:{url},video_id:{v_id},video_url:{video_url},ai_title:{new_title}"
|
|
|
+ log_data = f"user:{url},video_id:{v_id},video_url:{video_url},ai_title:{new_title},voice:{voice}"
|
|
|
AliyunLogger.logging(channel_id, name, url, v_id, "视频改造成功", "1000", log_data, str(code))
|
|
|
if channel_id == "快手历史" or channel_id == "抖音历史" or channel_id == "视频号历史":
|
|
|
explain = "历史爆款"
|
|
@@ -360,7 +370,7 @@ class VideoProcessor:
|
|
|
return new_video_path
|
|
|
|
|
|
@classmethod
|
|
|
- def handle_video_ending(cls, new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm):
|
|
|
+ def handle_video_ending(cls, new_video_path, video_ending, old_title, pw_random_id, video_path_url, mark, task_mark, url, name, video_share, zm, voice):
|
|
|
"""
|
|
|
处理视频片尾
|
|
|
"""
|
|
@@ -368,7 +378,7 @@ class VideoProcessor:
|
|
|
pw_srt_text = GPT4o.get_ai_pw(old_title)
|
|
|
if pw_srt_text:
|
|
|
|
|
|
- pw_url = TTS.get_pw_zm(pw_srt_text)
|
|
|
+ pw_url = TTS.get_pw_zm(pw_srt_text, voice)
|
|
|
if pw_url:
|
|
|
pw_mp3_path = TTS.download_mp3(pw_url, video_path_url, pw_random_id)
|
|
|
# oss_mp3_key = Oss.mp3_upload_oss(pw_mp3_path, pw_random_id)
|