|
@@ -64,7 +64,7 @@ def get_adcreatives(account_id,access_token,flag,adc_ids,dt): # 获取创意
|
|
|
|
|
|
|
|
|
if 'data' in r.keys():
|
|
|
-
|
|
|
+ is_video=0
|
|
|
for i in r['data']['list']:
|
|
|
# print(i)
|
|
|
|
|
@@ -77,8 +77,11 @@ def get_adcreatives(account_id,access_token,flag,adc_ids,dt): # 获取创意
|
|
|
image=d.get('image','')
|
|
|
elif 'image_list' in d.keys():
|
|
|
image =','.join(d.get('image_list'))
|
|
|
+ elif 'short_video_struct' in d.keys():
|
|
|
+ image = d['short_video_struct']["short_video1"]
|
|
|
+ is_video=1
|
|
|
else:
|
|
|
- image=''
|
|
|
+ image = ''
|
|
|
|
|
|
else:
|
|
|
title = image=''
|
|
@@ -88,7 +91,7 @@ def get_adcreatives(account_id,access_token,flag,adc_ids,dt): # 获取创意
|
|
|
i['adcreative_id'],i['adcreative_name'],i['campaign_id'],image,title,
|
|
|
i.get('promoted_object_type',''),i.get('page_type',''),
|
|
|
i['page_spec'].get('page_id',''),i.get('promoted_object_id',''),
|
|
|
- '',description,'MP',account_id,dt
|
|
|
+ '',description,'MP',account_id,dt,is_video
|
|
|
))
|
|
|
else:
|
|
|
if len(i['adcreative_elements'])>0:
|
|
@@ -112,7 +115,7 @@ def get_adcreatives(account_id,access_token,flag,adc_ids,dt): # 获取创意
|
|
|
i['adcreative_id'], i['adcreative_name'], i['campaign_id'],image,title,
|
|
|
i.get('promoted_object_type', ''), i.get('page_type', ''),
|
|
|
i['page_spec'].get('page_id', ''), i.get('promoted_object_id', ''),
|
|
|
- ','.join(i['site_set']),description,'GDT',account_id,dt
|
|
|
+ ','.join(i['site_set']),description,'GDT',account_id,dt,is_video
|
|
|
|
|
|
)
|
|
|
)
|
|
@@ -130,7 +133,7 @@ def get_adcreatives(account_id,access_token,flag,adc_ids,dt): # 获取创意
|
|
|
break
|
|
|
if len(li)>0:
|
|
|
print(f"{account_id}有创意:",len(li))
|
|
|
- sql='replace into adcreative_info values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) '
|
|
|
+ sql='replace into adcreative_info values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) '
|
|
|
db.quchen_text.executeMany(sql,li)
|
|
|
|
|
|
|