|
@@ -8,6 +8,7 @@ import json
|
|
|
import uuid
|
|
|
import requests
|
|
|
import urllib.parse
|
|
|
+from datetime import datetime, timedelta
|
|
|
|
|
|
from applications.functions.ask_kimi import ask_kimi
|
|
|
from applications.functions.calculate import title_mix
|
|
@@ -79,13 +80,16 @@ class ProcessParams(object):
|
|
|
@classmethod
|
|
|
def process(cls, data):
|
|
|
"""执行代码"""
|
|
|
+ today = datetime.today()
|
|
|
+ yesterday = today - timedelta(days=1)
|
|
|
+ yesterday_str = yesterday.strftime("%Y%m%d")
|
|
|
title = cls.get_params(data)
|
|
|
title_p = os.path.join(os.getcwd(), 'applications', 'static', "titles", "{}.json".format(title))
|
|
|
if os.path.exists(title_p):
|
|
|
- result = title_mix(title_p=title_p, dt="20240417")
|
|
|
+ result = title_mix(title_p=title_p, dt=yesterday_str)
|
|
|
else:
|
|
|
cls.ask_kimi_and_save_to_local(title)
|
|
|
- result = title_mix(title_p=title_p, dt="20240417")
|
|
|
+ result = title_mix(title_p=title_p, dt=yesterday_str)
|
|
|
uid, video_id = result['s1_uid'], result['s1_vid']
|
|
|
root_share_id, productionPath = cls.create_gzh_path(uid, video_id)
|
|
|
response = cls.request_for_info(video_id)
|