|
@@ -32,17 +32,23 @@ class AgcVidoe():
|
|
three_days_ago = current_time - timedelta(days=3)
|
|
three_days_ago = current_time - timedelta(days=3)
|
|
formatted_current_time = current_time.strftime("%Y-%m-%d")
|
|
formatted_current_time = current_time.strftime("%Y-%m-%d")
|
|
formatted_three_days_ago = three_days_ago.strftime("%Y-%m-%d")
|
|
formatted_three_days_ago = three_days_ago.strftime("%Y-%m-%d")
|
|
- url_list = f"""SELECT a.video_id,a.account_id,a.oss_object_key FROM agc_video_url a WHERE NOT EXISTS (
|
|
|
|
- SELECT video_id
|
|
|
|
- FROM agc_video_deposit b
|
|
|
|
- WHERE a.oss_object_key = b.oss_object_key AND b.time >= '{formatted_three_days_ago}' AND b.time <= '{formatted_current_time}'
|
|
|
|
- ) AND a.account_id = '{user}' and a.`status` = 1 and a.mark = '{mark}' limit {limit_count};"""
|
|
|
|
- print(url_list)
|
|
|
|
- url_list = MysqlHelper.get_values(url_list, "prod")
|
|
|
|
- if url_list:
|
|
|
|
- if limit_count == 1:
|
|
|
|
- return url_list
|
|
|
|
- else:
|
|
|
|
|
|
+ if limit_count == 1:
|
|
|
|
+ url_list = f"""SELECT a.video_id,a.account_id,a.oss_object_key FROM agc_video_url a WHERE NOT EXISTS (
|
|
|
|
+ SELECT video_id
|
|
|
|
+ FROM agc_video_deposit b
|
|
|
|
+ WHERE a.oss_object_key = b.oss_object_key AND b.time == '{formatted_current_time}'
|
|
|
|
+ ) AND a.account_id = '{user}' and a.`status` = 1 and a.mark = '{mark}' limit {limit_count};"""
|
|
|
|
+ url_list = MysqlHelper.get_values(url_list, "prod")
|
|
|
|
+ if url_list:
|
|
|
|
+ return url_list
|
|
|
|
+ else:
|
|
|
|
+ url_list = f"""SELECT a.video_id,a.account_id,a.oss_object_key FROM agc_video_url a WHERE NOT EXISTS (
|
|
|
|
+ SELECT video_id
|
|
|
|
+ FROM agc_video_deposit b
|
|
|
|
+ WHERE a.oss_object_key = b.oss_object_key AND b.time >= '{formatted_three_days_ago}' AND b.time <= '{formatted_current_time}'
|
|
|
|
+ ) AND a.account_id = '{user}' and a.`status` = 1 and a.mark = '{mark}' limit {limit_count};"""
|
|
|
|
+ url_list = MysqlHelper.get_values(url_list, "prod")
|
|
|
|
+ if url_list:
|
|
if len(url_list) >= 30:
|
|
if len(url_list) >= 30:
|
|
return url_list
|
|
return url_list
|
|
return None
|
|
return None
|