|
@@ -76,7 +76,7 @@ left join (
|
|
|
select account_id,access_token,'MP' type from advertiser_vx where (name !='' or name is not null) union
|
|
|
select account_id,access_token,'GDT' type from advertiser_qq where (name !='' or name is not null)
|
|
|
) b on a.account_id=b.account_id
|
|
|
-where a.dt='{dt}'
|
|
|
+where a.dt='{dt}' and a.is_video=0
|
|
|
GROUP BY b.account_id,b.access_token,b.type"""
|
|
|
accounts = db.quchen_text.getData(sql)
|
|
|
executor = ThreadPoolExecutor(max_workers=max_workers)
|
|
@@ -85,6 +85,20 @@ GROUP BY b.account_id,b.access_token,b.type"""
|
|
|
executor.shutdown()
|
|
|
|
|
|
|
|
|
+def video(dt):
|
|
|
+ sql = f"""SELECT b.account_id,b.access_token,b.type,GROUP_CONCAT(image_id) from adcreative_info a
|
|
|
+ left join (
|
|
|
+ select account_id,access_token,'MP' type from advertiser_vx where (name !='' or name is not null) union
|
|
|
+ select account_id,access_token,'GDT' type from advertiser_qq where (name !='' or name is not null)
|
|
|
+ ) b on a.account_id=b.account_id
|
|
|
+ where a.dt='{dt}' and a.is_video=1
|
|
|
+ GROUP BY b.account_id,b.access_token,b.type"""
|
|
|
+ accounts = db.quchen_text.getData(sql)
|
|
|
+ executor = ThreadPoolExecutor(max_workers=max_workers)
|
|
|
+ for account in accounts:
|
|
|
+ executor.submit(video_info_get, account[0], account[1], account[3])
|
|
|
+ executor.shutdown()
|
|
|
+
|
|
|
def run(dt):
|
|
|
"""
|
|
|
1.拉取有消耗的广告
|
|
@@ -98,6 +112,8 @@ def run(dt):
|
|
|
ad(dt)
|
|
|
adcreative(dt)
|
|
|
image(dt)
|
|
|
+ video(dt)
|
|
|
+
|
|
|
except:
|
|
|
DingTalkUtils.send("拉取广告数据出错")
|
|
|
|
|
@@ -125,7 +141,8 @@ if __name__ == '__main__':
|
|
|
|
|
|
# day()
|
|
|
# run('2021-05-10')
|
|
|
- adcreative('2021-05-11')
|
|
|
+ # adcreative('2021-05-11')
|
|
|
+ video('2021-05-14')
|
|
|
# for dt in list(reversed(du.getDateLists('2020-04-08','2021-04-09'))):
|
|
|
# print(dt)
|
|
|
# ad(dt)
|