|
@@ -1,3 +1,4 @@
|
|
|
|
+# encodings : utf-8
|
|
"""
|
|
"""
|
|
@author: luojunhui
|
|
@author: luojunhui
|
|
"""
|
|
"""
|
|
@@ -18,6 +19,7 @@ def find_fail_data(dt):
|
|
"""
|
|
"""
|
|
M = MatchRate()
|
|
M = MatchRate()
|
|
time_stamp_list = M.generate_stamp_list(dt, dt)
|
|
time_stamp_list = M.generate_stamp_list(dt, dt)
|
|
|
|
+ c = 0
|
|
for item in time_stamp_list:
|
|
for item in time_stamp_list:
|
|
s_d = int(item)
|
|
s_d = int(item)
|
|
e_d = int(item) + 24 * 60 * 60 * 1000
|
|
e_d = int(item) + 24 * 60 * 60 * 1000
|
|
@@ -34,6 +36,7 @@ def find_fail_data(dt):
|
|
elif obj[0] == 1:
|
|
elif obj[0] == 1:
|
|
p += 1
|
|
p += 1
|
|
w.append(obj[1])
|
|
w.append(obj[1])
|
|
|
|
+ c += 1
|
|
long_time_data = [i for i in w if int(time.time()) - int(i.split("-")[-1]) > 3600]
|
|
long_time_data = [i for i in w if int(time.time()) - int(i.split("-")[-1]) > 3600]
|
|
return tuple(long_time_data)
|
|
return tuple(long_time_data)
|
|
|
|
|
|
@@ -44,7 +47,7 @@ def find_defeat_info(trace_id_tuple):
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
select_sql = f"""
|
|
select_sql = f"""
|
|
- select trace_id, article_title, article_text, gh_id, account_name
|
|
|
|
|
|
+ select trace_id, article_title, gh_id, `kimi_summary` , `kimi_keys`
|
|
from `long_articles_video` where `trace_id` in {trace_id_tuple};
|
|
from `long_articles_video` where `trace_id` in {trace_id_tuple};
|
|
"""
|
|
"""
|
|
connection = pymysql.connect(
|
|
connection = pymysql.connect(
|
|
@@ -69,10 +72,9 @@ def request_for_research(result):
|
|
params = {
|
|
params = {
|
|
"trace_id": result[0],
|
|
"trace_id": result[0],
|
|
"title": result[1],
|
|
"title": result[1],
|
|
- "ghId": result[3],
|
|
|
|
- "content": result[2],
|
|
|
|
- "accountName": result[4]
|
|
|
|
-
|
|
|
|
|
|
+ "ghId": result[2],
|
|
|
|
+ "kimi_summary": result[3],
|
|
|
|
+ "kimi_keys": result[4]
|
|
}
|
|
}
|
|
url = "http://47.99.132.47:8111/re_search_videos"
|
|
url = "http://47.99.132.47:8111/re_search_videos"
|
|
a = time.time()
|
|
a = time.time()
|
|
@@ -92,17 +94,19 @@ def job2():
|
|
"""
|
|
"""
|
|
date_str = datetime.datetime.today().strftime("%Y%m%d")
|
|
date_str = datetime.datetime.today().strftime("%Y%m%d")
|
|
trace_id_t = find_fail_data(dt=date_str)
|
|
trace_id_t = find_fail_data(dt=date_str)
|
|
- fail_list = find_defeat_info(trace_id_t)
|
|
|
|
- now_time_str = datetime.datetime.now().__str__()
|
|
|
|
- if fail_list:
|
|
|
|
- print("{} find {} defeat requests".format(now_time_str, len(fail_list)))
|
|
|
|
- count = 1
|
|
|
|
- for obj in fail_list:
|
|
|
|
- request_for_research(obj)
|
|
|
|
- count += 1
|
|
|
|
- print("{} success re_search {} defeat requests".format(now_time_str, count))
|
|
|
|
- else:
|
|
|
|
- print("{} No videos Find".format(now_time_str))
|
|
|
|
|
|
+ if trace_id_t:
|
|
|
|
+ fail_list = find_defeat_info(trace_id_t)
|
|
|
|
+ now_time_str = datetime.datetime.now().__str__()
|
|
|
|
+ if fail_list:
|
|
|
|
+ print("{} find {} defeat requests".format(now_time_str, len(fail_list)))
|
|
|
|
+ count = 1
|
|
|
|
+ for obj in fail_list:
|
|
|
|
+ print(obj)
|
|
|
|
+ request_for_research(obj)
|
|
|
|
+ count += 1
|
|
|
|
+ print("{} success re_search {} defeat requests".format(now_time_str, count))
|
|
|
|
+ else:
|
|
|
|
+ print("{} No videos Find".format(now_time_str))
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|