lazyad 0.0.22__py3-none-any.whl → 0.0.24__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lazyad might be problematic. Click here for more details.
- lazyad/crawlers/chuangliang.py +141 -1
- {lazyad-0.0.22.dist-info → lazyad-0.0.24.dist-info}/METADATA +1 -1
- {lazyad-0.0.22.dist-info → lazyad-0.0.24.dist-info}/RECORD +5 -5
- {lazyad-0.0.22.dist-info → lazyad-0.0.24.dist-info}/WHEEL +0 -0
- {lazyad-0.0.22.dist-info → lazyad-0.0.24.dist-info}/top_level.txt +0 -0
lazyad/crawlers/chuangliang.py
CHANGED
|
@@ -319,7 +319,10 @@ def update_ad_batch(
|
|
|
319
319
|
advertiser_ids: list = None,
|
|
320
320
|
campaign_id: int = None,
|
|
321
321
|
campaign_ids: list = None,
|
|
322
|
-
|
|
322
|
+
adgroup_feed_id: int = None,
|
|
323
|
+
adgroup_feed_ids: list = None,
|
|
324
|
+
field: str = "disable",
|
|
325
|
+
operate: str = "disable"
|
|
323
326
|
):
|
|
324
327
|
"""
|
|
325
328
|
暂停广告
|
|
@@ -354,6 +357,15 @@ def update_ad_batch(
|
|
|
354
357
|
}
|
|
355
358
|
else:
|
|
356
359
|
return
|
|
360
|
+
elif media_type == "baidu":
|
|
361
|
+
url = "https://cli2.mobgi.com/Baidu/AdGroup/batchUpdate"
|
|
362
|
+
if not adgroup_feed_ids:
|
|
363
|
+
adgroup_feed_ids = [adgroup_feed_id]
|
|
364
|
+
post_data = {
|
|
365
|
+
"adgroup_feed_ids": adgroup_feed_ids,
|
|
366
|
+
"opt_status": operate
|
|
367
|
+
}
|
|
368
|
+
|
|
357
369
|
else:
|
|
358
370
|
return
|
|
359
371
|
return lazyrequests.lazy_requests(
|
|
@@ -362,3 +374,131 @@ def update_ad_batch(
|
|
|
362
374
|
json=post_data,
|
|
363
375
|
headers=headers
|
|
364
376
|
)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
def get_material_report(
|
|
380
|
+
cookie: str,
|
|
381
|
+
start_date: str = None,
|
|
382
|
+
end_date: str = None,
|
|
383
|
+
page: int = 1,
|
|
384
|
+
page_size: int = 20,
|
|
385
|
+
media_type: str = "aggregate",
|
|
386
|
+
kpis: list = None,
|
|
387
|
+
sort_field: str = None,
|
|
388
|
+
time_dim: str = "days",
|
|
389
|
+
data_dim: str = "material",
|
|
390
|
+
data_type: str = "list",
|
|
391
|
+
sort_direction: str = "desc",
|
|
392
|
+
conditions: dict = None,
|
|
393
|
+
relate_dims: list = None
|
|
394
|
+
):
|
|
395
|
+
"""
|
|
396
|
+
报表-素材报表
|
|
397
|
+
:param cookie:
|
|
398
|
+
:param start_date:
|
|
399
|
+
:param end_date:
|
|
400
|
+
:param page:
|
|
401
|
+
:param page_size:
|
|
402
|
+
:param media_type:媒体:gdt_new|广点通(新指标体系),toutiao_upgrade|今日头条2.0,aggregate|不限,baidu:百度信息流
|
|
403
|
+
:param data_dim:
|
|
404
|
+
:param data_type:
|
|
405
|
+
:param sort_direction:
|
|
406
|
+
:param sort_field:
|
|
407
|
+
:param time_dim: 时间维度的数据汇总方式,days:分日,sum:汇总
|
|
408
|
+
:param conditions:
|
|
409
|
+
:param kpis:
|
|
410
|
+
:param relate_dims:
|
|
411
|
+
:return:
|
|
412
|
+
"""
|
|
413
|
+
if not start_date:
|
|
414
|
+
start_date = lazytime.get_date_string(days=0)
|
|
415
|
+
if not end_date:
|
|
416
|
+
end_date = lazytime.get_date_string(days=0)
|
|
417
|
+
url = "https://cli2.mobgi.com/ReportV23/MaterialReport/getReport"
|
|
418
|
+
data = {
|
|
419
|
+
"time_dim": time_dim,
|
|
420
|
+
"media_type": media_type,
|
|
421
|
+
"data_type": data_type,
|
|
422
|
+
"data_dim": data_dim,
|
|
423
|
+
"sort_field": sort_field,
|
|
424
|
+
"sort_direction": sort_direction,
|
|
425
|
+
"start_date": start_date,
|
|
426
|
+
"end_date": end_date,
|
|
427
|
+
"page": page,
|
|
428
|
+
"page_size": page_size
|
|
429
|
+
}
|
|
430
|
+
if media_type == "baidu":
|
|
431
|
+
if not conditions:
|
|
432
|
+
conditions = {
|
|
433
|
+
"search_type": "name",
|
|
434
|
+
"media_project_id": [],
|
|
435
|
+
"material_special_id": [],
|
|
436
|
+
"make_user_id": [],
|
|
437
|
+
"advertiser_id": [],
|
|
438
|
+
"owner_user_id": [],
|
|
439
|
+
"media_advertiser_company": [],
|
|
440
|
+
"material_type": "",
|
|
441
|
+
"label_ids": [],
|
|
442
|
+
"material_group_id": []
|
|
443
|
+
}
|
|
444
|
+
if not kpis:
|
|
445
|
+
kpis = [
|
|
446
|
+
"cost",
|
|
447
|
+
"weixinfollowsuccessconversions",
|
|
448
|
+
"weixinfollowsuccessconversionscost",
|
|
449
|
+
"payreaduv",
|
|
450
|
+
"payreaduvcost"
|
|
451
|
+
]
|
|
452
|
+
if not relate_dims:
|
|
453
|
+
relate_dims = [
|
|
454
|
+
"material_create_time",
|
|
455
|
+
"owner_user_id",
|
|
456
|
+
"creative_user_id",
|
|
457
|
+
"adgroup_feed_id"
|
|
458
|
+
]
|
|
459
|
+
elif media_type == "gdt_new":
|
|
460
|
+
if not conditions:
|
|
461
|
+
conditions = {
|
|
462
|
+
"advertiser_id": [],
|
|
463
|
+
"label_ids": [],
|
|
464
|
+
"make_user_id": [],
|
|
465
|
+
"material_group_id": [],
|
|
466
|
+
"material_special_id": [],
|
|
467
|
+
"material_type": "",
|
|
468
|
+
"media_advertiser_company": [],
|
|
469
|
+
"media_project_id": [],
|
|
470
|
+
"owner_user_id": [],
|
|
471
|
+
"search_type": "name"
|
|
472
|
+
}
|
|
473
|
+
if not kpis:
|
|
474
|
+
kpis = [
|
|
475
|
+
"cost",
|
|
476
|
+
"cheout_fd",
|
|
477
|
+
"cheout_fd_reward",
|
|
478
|
+
"first_pay_count",
|
|
479
|
+
"first_pay_cost",
|
|
480
|
+
"conversions_count",
|
|
481
|
+
"conversions_cost",
|
|
482
|
+
"from_follow_uv",
|
|
483
|
+
"from_follow_cost",
|
|
484
|
+
"thousand_display_price"
|
|
485
|
+
]
|
|
486
|
+
if not relate_dims:
|
|
487
|
+
relate_dims = []
|
|
488
|
+
else:
|
|
489
|
+
pass
|
|
490
|
+
|
|
491
|
+
if conditions:
|
|
492
|
+
data["conditions"] = conditions
|
|
493
|
+
if kpis:
|
|
494
|
+
data["kpis"] = kpis
|
|
495
|
+
if relate_dims:
|
|
496
|
+
data["relate_dims"] = relate_dims
|
|
497
|
+
headers = copy.deepcopy(default_headers)
|
|
498
|
+
headers["Cookie"] = cookie
|
|
499
|
+
return lazyrequests.lazy_requests(
|
|
500
|
+
method="POST",
|
|
501
|
+
url=url,
|
|
502
|
+
json=data,
|
|
503
|
+
headers=headers
|
|
504
|
+
)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
lazyad/__init__.py,sha256=tnVTFEgdzgMWQI0mZqy3DAueMJjpypPb15DdxJ-9TiU,41
|
|
2
2
|
lazyad/crawlers/__init__.py,sha256=GK3GGpiUJbESc1uGTwSmEnsSUwYDNZfJCxeLYB4CpS4,68
|
|
3
|
-
lazyad/crawlers/chuangliang.py,sha256=
|
|
3
|
+
lazyad/crawlers/chuangliang.py,sha256=M6_myz1SHJhhoPhhpEBX9WFCUYdPNxQ-tF3HhzcrZ6M,15405
|
|
4
4
|
lazyad/crawlers/oceanengine.py,sha256=kjBEpCb_h5OpodCTqzvXd5MBBwAuw3Oq5UKWoTCXrQM,4540
|
|
5
5
|
lazyad/crawlers/qq.py,sha256=mAVOP1TOGVD1juu77uKBauN7vLymukTJ1mJ8uyRh9a8,3230
|
|
6
6
|
lazyad/open/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
lazyad/open/qq.py,sha256=B6HWnBmtF3mbpwto1wqi7j-auK73Kzp8ESxeUpvLHRA,4391
|
|
8
|
-
lazyad-0.0.
|
|
9
|
-
lazyad-0.0.
|
|
10
|
-
lazyad-0.0.
|
|
11
|
-
lazyad-0.0.
|
|
8
|
+
lazyad-0.0.24.dist-info/METADATA,sha256=l70qohDxNuN4Yn3mMtcb0OC6c4E321zpPWTh5Zj2mKY,1695
|
|
9
|
+
lazyad-0.0.24.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
10
|
+
lazyad-0.0.24.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
|
|
11
|
+
lazyad-0.0.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|