|
@@ -109,11 +109,11 @@ class AiHistoricalMissingMaterial(tornado.web.RequestHandler):
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的补充遗漏素材请求已走完!" % account_id}))
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的补充遗漏素材请求已走完!" % account_id}))
|
|
self.flush()
|
|
self.flush()
|
|
else:
|
|
else:
|
|
- video_info = get_missing_video_info(account_id,
|
|
|
|
- missing_video_cnt,
|
|
|
|
- get_missing_video_url,
|
|
|
|
- missing_video_start_time,
|
|
|
|
- missing_video_end_time)
|
|
|
|
|
|
+ video_info = get_missing_video_info(account_id=account_id,
|
|
|
|
+ cnt=missing_video_cnt,
|
|
|
|
+ url=get_missing_video_url,
|
|
|
|
+ start_time=missing_video_start_time,
|
|
|
|
+ end_time=missing_video_end_time)
|
|
if video_info['code'] != 0:
|
|
if video_info['code'] != 0:
|
|
logger.info("account_id = %s,补充历史遗漏素材,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
logger.info("account_id = %s,补充历史遗漏素材,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
self.write(json.dumps({"account_id": account_id,
|
|
self.write(json.dumps({"account_id": account_id,
|
|
@@ -239,7 +239,8 @@ class AiAutoCreative(tornado.web.RequestHandler):
|
|
campaign_id = getattr(row, 'campaign_id')
|
|
campaign_id = getattr(row, 'campaign_id')
|
|
break
|
|
break
|
|
|
|
|
|
- video_info = get_new_video_info(account_id, get_new_video_url)
|
|
|
|
|
|
+ video_info = get_new_video_info(account_id=account_id,
|
|
|
|
+ url=get_new_video_url)
|
|
if video_info['code'] != 0:
|
|
if video_info['code'] != 0:
|
|
self.write(json.dumps({"account_id": account_id, "message": "素材自动上新没有获取到视频,不发送ai策略请求!"}))
|
|
self.write(json.dumps({"account_id": account_id, "message": "素材自动上新没有获取到视频,不发送ai策略请求!"}))
|
|
self.flush()
|
|
self.flush()
|
|
@@ -359,11 +360,13 @@ class AiHighQualityMaterial(tornado.web.RequestHandler):
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的高质量素材复建请求已走完!" % account_id}))
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的高质量素材复建请求已走完!" % account_id}))
|
|
self.flush()
|
|
self.flush()
|
|
else:
|
|
else:
|
|
- video_info = get_top_video_info(account_id, high_quality_video_cnt,
|
|
|
|
- (datetime.datetime.now() + datetime.timedelta(
|
|
|
|
- days=-high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
- datetime.date.today().strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
- get_high_quality_video_url)
|
|
|
|
|
|
+ video_info = get_top_video_info(account_id=account_id,
|
|
|
|
+ cnt=high_quality_video_cnt,
|
|
|
|
+ start_time=(datetime.datetime.now() +
|
|
|
|
+ datetime.timedelta(days=-high_quality_video_days)).
|
|
|
|
+ strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
+ end_time=datetime.date.today().strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
+ url=get_high_quality_video_url)
|
|
if video_info['code'] != 0:
|
|
if video_info['code'] != 0:
|
|
logger.info("account_id = %s, 高质量素材复建,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
logger.info("account_id = %s, 高质量素材复建,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
self.write(json.dumps({"account_id": account_id,
|
|
self.write(json.dumps({"account_id": account_id,
|
|
@@ -443,11 +446,11 @@ class AiCheckAndUpTOFullCreative(tornado.web.RequestHandler):
|
|
|
|
|
|
# 3-1 获取视频信息
|
|
# 3-1 获取视频信息
|
|
if video_cnt == 0:
|
|
if video_cnt == 0:
|
|
- logger.info("创意已经建满,不需要补充素材!")
|
|
|
|
- self.write(json.dumps("message: 创意已经建满,不需要补充素材!"))
|
|
|
|
|
|
+ logger.info("account_id = %s, 创意已经建满,不需要补充素材!" % account_id)
|
|
|
|
+ self.write(json.dumps({"account_id": account_id, "message": "创意已经建满,不需要补充素材!"}))
|
|
self.flush()
|
|
self.flush()
|
|
else:
|
|
else:
|
|
- logger.info("需要补充的视频数量:%s" % video_cnt)
|
|
|
|
|
|
+ logger.info("account_id = %s, 需要补充的视频数量 = %s" % (account_id, video_cnt))
|
|
|
|
|
|
sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
|
|
sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
|
|
where account_id=%s order by create_time desc limit 1
|
|
where account_id=%s order by create_time desc limit 1
|
|
@@ -522,11 +525,11 @@ class AiCheckAndUpTOFullCreative(tornado.web.RequestHandler):
|
|
campaign_id = getattr(row, 'campaign_id')
|
|
campaign_id = getattr(row, 'campaign_id')
|
|
break
|
|
break
|
|
|
|
|
|
- video_info = get_top_video_info(account_id,
|
|
|
|
- video_cnt,
|
|
|
|
- (now + datetime.timedelta(days=-2*high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
- (now + datetime.timedelta(days=-high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
- get_high_quality_video_url)
|
|
|
|
|
|
+ video_info = get_top_video_info(account_id=account_id,
|
|
|
|
+ cnt=video_cnt,
|
|
|
|
+ start_time=(now + datetime.timedelta(days=-2*high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
+ end_time=(now + datetime.timedelta(days=-high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
+ url=get_high_quality_video_url)
|
|
if video_info['code'] != 0:
|
|
if video_info['code'] != 0:
|
|
logger.info("account_id = %s, 历史高质量素材填满, 没有获取到视频,不发送ai策略请求!" % account_id)
|
|
logger.info("account_id = %s, 历史高质量素材填满, 没有获取到视频,不发送ai策略请求!" % account_id)
|
|
self.write(json.dumps({"account_id": account_id,
|
|
self.write(json.dumps({"account_id": account_id,
|
|
@@ -651,11 +654,12 @@ class AiProgramCreativeHighQualityMaterial(tornado.web.RequestHandler):
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的高质量素材程序化创意的请求已走完!" % account_id}))
|
|
self.write(json.dumps({"message": "account_id=%s, 多应用的高质量素材程序化创意的请求已走完!" % account_id}))
|
|
self.flush()
|
|
self.flush()
|
|
else:
|
|
else:
|
|
- video_info = get_top_video_info(account_id, programme_high_quality_video_cnt,
|
|
|
|
- (datetime.datetime.now() + datetime.timedelta(
|
|
|
|
|
|
+ video_info = get_top_video_info(account_id=account_id,
|
|
|
|
+ cnt=programme_high_quality_video_cnt,
|
|
|
|
+ start_time=(datetime.datetime.now() + datetime.timedelta(
|
|
days=-high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
days=-high_quality_video_days)).strftime("%Y-%m-%d %H:%M:%S"),
|
|
- datetime.date.today().strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
- get_high_quality_video_url)
|
|
|
|
|
|
+ end_time=datetime.date.today().strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
+ url=get_high_quality_video_url)
|
|
if video_info['code'] != 0:
|
|
if video_info['code'] != 0:
|
|
logger.info("account_id = %s, 程序化高质量素材,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
logger.info("account_id = %s, 程序化高质量素材,没有获取到视频,不发送ai策略请求!" % account_id)
|
|
self.write(json.dumps({"account_id": account_id,
|
|
self.write(json.dumps({"account_id": account_id,
|