|
@@ -13,10 +13,12 @@ import requests
|
|
|
from datetime import datetime, timedelta
|
|
|
from urllib.parse import urlencode
|
|
|
|
|
|
+
|
|
|
sys.path.append(os.getcwd())
|
|
|
from common.db import MysqlHelper
|
|
|
from common.material import Material
|
|
|
from common import Common, Oss, Feishu
|
|
|
+from common.srt import SRT
|
|
|
|
|
|
config = configparser.ConfigParser()
|
|
|
config.read('./config.ini') # 替换为您的配置文件路径
|
|
@@ -604,7 +606,7 @@ class AgcVidoe():
|
|
|
s_path, v_path, video_path_url, v_oss_path = cls.create_folders(mark)
|
|
|
|
|
|
kb_count = int(result[1][1])
|
|
|
- channel = ['douyin', 'kuaishou', 'koubo']
|
|
|
+ channel = ['kuaishou', 'douyin', 'koubo']
|
|
|
try:
|
|
|
for platform in channel:
|
|
|
limit_count = 35
|
|
@@ -631,11 +633,16 @@ class AgcVidoe():
|
|
|
videos = [list(item) for item in url_list]
|
|
|
# 下载视频
|
|
|
videos = Oss.get_oss_url(videos, video_path_url)
|
|
|
-
|
|
|
if srt:
|
|
|
# 创建临时字幕文件
|
|
|
cls.create_subtitle_file(srt, s_path)
|
|
|
Common.logger("video").info(f"S{mark}的{platform}渠道RT 文件目录创建成功")
|
|
|
+ else:
|
|
|
+ srt_new = SRT.getSrt(int(uid))
|
|
|
+ if srt_new:
|
|
|
+ # 创建临时字幕文件
|
|
|
+ cls.create_subtitle_file(srt_new, s_path)
|
|
|
+ Common.logger("gs_video").info(f"S{mark}的{platform}渠道RT 文件目录创建成功")
|
|
|
# 获取音频
|
|
|
audio_video = cls.get_audio_url(uid, mark, mark_name)
|
|
|
Common.logger("video").info(f"{mark}的{platform}渠道获取需要拼接的音频成功")
|
|
@@ -753,6 +760,12 @@ class AgcVidoe():
|
|
|
# 创建临时字幕文件
|
|
|
cls.create_subtitle_file(srt, s_path)
|
|
|
Common.logger("gs_video").info(f"S{mark}的{platform}渠道RT 文件目录创建成功")
|
|
|
+ else:
|
|
|
+ srt_new = SRT.getSrt(int(uid))
|
|
|
+ if srt_new:
|
|
|
+ # 创建临时字幕文件
|
|
|
+ cls.create_subtitle_file(srt_new, s_path)
|
|
|
+ Common.logger("gs_video").info(f"S{mark}的{platform}渠道RT 文件目录创建成功")
|
|
|
# 获取音频
|
|
|
audio_video = cls.get_audio_url(uid, mark, mark_name)
|
|
|
Common.logger("gs_video").info(f"{mark}的{platform}渠道获取需要拼接的音频成功")
|
|
@@ -839,6 +852,12 @@ class AgcVidoe():
|
|
|
# 创建临时字幕文件
|
|
|
cls.create_subtitle_file(srt, s_path)
|
|
|
Common.logger("bk_video").info(f"S{mark} 文件目录创建成功")
|
|
|
+ else:
|
|
|
+ srt_new = SRT.getSrt(int(uid))
|
|
|
+ if srt_new:
|
|
|
+ # 创建临时字幕文件
|
|
|
+ cls.create_subtitle_file(srt_new, s_path)
|
|
|
+ Common.logger("gs_video").info(f"S{mark}的{platform}渠道RT 文件目录创建成功")
|
|
|
# 获取音频
|
|
|
audio_video = cls.get_audio_url(uid, mark, mark_name)
|
|
|
Common.logger("bk_video").info(f"{mark}获取需要拼接的音频成功")
|