Forráskód Böngészése

巨量引擎的素材链接替换为永久链接

liyuyi@c-top.com.cn 4 éve
szülő
commit
dd67b4455b
2 módosított fájl, 8 hozzáadás és 0 törlés
  1. 3 0
      config/url.py
  2. 5 0
      get_high_quality_script.py

+ 3 - 0
config/url.py

@@ -14,3 +14,6 @@ get_material_info_from_ocean_engine_url = "https://cc.oceanengine.com/creative_r
 
 # 依据 vid, 从巨量引擎获取视频信息
 get_video_info_from_ocean_engine_url = "https://cc.oceanengine.com/creative_content_server/api/video/info"
+
+# 头条素材永久链接
+toutiao_static_video_url = "http://i.snssdk.com/video/code/1/toutiao/"

+ 5 - 0
get_high_quality_script.py

@@ -5,6 +5,7 @@ import yaml
 from common_func import get_db_engine, get_logger
 from get_script_from_tengxunyun import GetScriptFromTengXunYunServer
 import traceback
+from config.url import toutiao_static_video_url
 
 if __name__ == '__main__':
     # 0 创建日志对象
@@ -107,6 +108,10 @@ if __name__ == '__main__':
                 sql = """select signature, video_url  from ctop_ai_video_info_from_ocean_engine 
                 where project_name = '%s' and stat_date >= '%s'""" % (project_name, one_week_date)
                 df = pd.read_sql(sql, test_read_engine)
+
+                # 把 video_url 替换为永久的链接, 导出excel用
+                df['video_url'] = toutiao_static_video_url + df['signature']
+
                 logger.info("项目:%s, 巨量引擎优质素材个数为 %s!" % (project_name, len(df)))
 
                 sql = """select md5 signature,task_result from tb_asr_result where word_text is not null and md5 in %s""" \