lazyad 0.0.22__tar.gz → 0.0.23__tar.gz
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-0.0.22 → lazyad-0.0.23}/PKG-INFO +1 -1
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/crawlers/chuangliang.py +128 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.22 → lazyad-0.0.23}/setup.py +1 -1
- {lazyad-0.0.22 → lazyad-0.0.23}/README.md +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/__init__.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad/open/qq.py +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.22 → lazyad-0.0.23}/setup.cfg +0 -0
|
@@ -362,3 +362,131 @@ def update_ad_batch(
|
|
|
362
362
|
json=post_data,
|
|
363
363
|
headers=headers
|
|
364
364
|
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def get_material_report(
|
|
368
|
+
cookie: str,
|
|
369
|
+
start_date: str = None,
|
|
370
|
+
end_date: str = None,
|
|
371
|
+
page: int = 1,
|
|
372
|
+
page_size: int = 20,
|
|
373
|
+
media_type: str = "aggregate",
|
|
374
|
+
kpis: list = None,
|
|
375
|
+
sort_field: str = None,
|
|
376
|
+
time_dim: str = "days",
|
|
377
|
+
data_dim: str = "material",
|
|
378
|
+
data_type: str = "list",
|
|
379
|
+
sort_direction: str = "desc",
|
|
380
|
+
conditions: dict = None,
|
|
381
|
+
relate_dims: list = None
|
|
382
|
+
):
|
|
383
|
+
"""
|
|
384
|
+
报表-素材报表
|
|
385
|
+
:param cookie:
|
|
386
|
+
:param start_date:
|
|
387
|
+
:param end_date:
|
|
388
|
+
:param page:
|
|
389
|
+
:param page_size:
|
|
390
|
+
:param media_type:媒体:gdt_new|广点通(新指标体系),toutiao_upgrade|今日头条2.0,aggregate|不限,baidu:百度信息流
|
|
391
|
+
:param data_dim:
|
|
392
|
+
:param data_type:
|
|
393
|
+
:param sort_direction:
|
|
394
|
+
:param sort_field:
|
|
395
|
+
:param time_dim:
|
|
396
|
+
:param conditions:
|
|
397
|
+
:param kpis:
|
|
398
|
+
:param relate_dims:
|
|
399
|
+
:return:
|
|
400
|
+
"""
|
|
401
|
+
if not start_date:
|
|
402
|
+
start_date = lazytime.get_date_string(days=0)
|
|
403
|
+
if not end_date:
|
|
404
|
+
end_date = lazytime.get_date_string(days=0)
|
|
405
|
+
url = "https://cli2.mobgi.com/ReportV23/MaterialReport/getReport"
|
|
406
|
+
data = {
|
|
407
|
+
"time_dim": time_dim,
|
|
408
|
+
"media_type": media_type,
|
|
409
|
+
"data_type": data_type,
|
|
410
|
+
"data_dim": data_dim,
|
|
411
|
+
"sort_field": sort_field,
|
|
412
|
+
"sort_direction": sort_direction,
|
|
413
|
+
"start_date": start_date,
|
|
414
|
+
"end_date": end_date,
|
|
415
|
+
"page": page,
|
|
416
|
+
"page_size": page_size
|
|
417
|
+
}
|
|
418
|
+
if media_type == "baidu":
|
|
419
|
+
if not conditions:
|
|
420
|
+
conditions = {
|
|
421
|
+
"search_type": "name",
|
|
422
|
+
"media_project_id": [],
|
|
423
|
+
"material_special_id": [],
|
|
424
|
+
"make_user_id": [],
|
|
425
|
+
"advertiser_id": [],
|
|
426
|
+
"owner_user_id": [],
|
|
427
|
+
"media_advertiser_company": [],
|
|
428
|
+
"material_type": "",
|
|
429
|
+
"label_ids": [],
|
|
430
|
+
"material_group_id": []
|
|
431
|
+
}
|
|
432
|
+
if not kpis:
|
|
433
|
+
kpis = [
|
|
434
|
+
"cost",
|
|
435
|
+
"weixinfollowsuccessconversions",
|
|
436
|
+
"weixinfollowsuccessconversionscost",
|
|
437
|
+
"payreaduv",
|
|
438
|
+
"payreaduvcost"
|
|
439
|
+
]
|
|
440
|
+
if not relate_dims:
|
|
441
|
+
relate_dims = [
|
|
442
|
+
"material_create_time",
|
|
443
|
+
"owner_user_id",
|
|
444
|
+
"creative_user_id",
|
|
445
|
+
"adgroup_feed_id"
|
|
446
|
+
]
|
|
447
|
+
elif media_type == "gdt_new":
|
|
448
|
+
if not conditions:
|
|
449
|
+
conditions = {
|
|
450
|
+
"advertiser_id": [],
|
|
451
|
+
"label_ids": [],
|
|
452
|
+
"make_user_id": [],
|
|
453
|
+
"material_group_id": [],
|
|
454
|
+
"material_special_id": [],
|
|
455
|
+
"material_type": "",
|
|
456
|
+
"media_advertiser_company": [],
|
|
457
|
+
"media_project_id": [],
|
|
458
|
+
"owner_user_id": [],
|
|
459
|
+
"search_type": "name"
|
|
460
|
+
}
|
|
461
|
+
if not kpis:
|
|
462
|
+
kpis = [
|
|
463
|
+
"cost",
|
|
464
|
+
"cheout_fd",
|
|
465
|
+
"cheout_fd_reward",
|
|
466
|
+
"first_pay_count",
|
|
467
|
+
"first_pay_cost",
|
|
468
|
+
"conversions_count",
|
|
469
|
+
"conversions_cost",
|
|
470
|
+
"from_follow_uv",
|
|
471
|
+
"from_follow_cost",
|
|
472
|
+
"thousand_display_price"
|
|
473
|
+
]
|
|
474
|
+
if not relate_dims:
|
|
475
|
+
relate_dims = []
|
|
476
|
+
else:
|
|
477
|
+
pass
|
|
478
|
+
|
|
479
|
+
if conditions:
|
|
480
|
+
data["conditions"] = conditions
|
|
481
|
+
if kpis:
|
|
482
|
+
data["kpis"] = kpis
|
|
483
|
+
if relate_dims:
|
|
484
|
+
data["relate_dims"] = relate_dims
|
|
485
|
+
headers = copy.deepcopy(default_headers)
|
|
486
|
+
headers["Cookie"] = cookie
|
|
487
|
+
return lazyrequests.lazy_requests(
|
|
488
|
+
method="POST",
|
|
489
|
+
url=url,
|
|
490
|
+
json=data,
|
|
491
|
+
headers=headers
|
|
492
|
+
)
|
|
@@ -13,7 +13,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
|
|
13
13
|
|
|
14
14
|
setuptools.setup(
|
|
15
15
|
name="lazyad",
|
|
16
|
-
version="0.0.
|
|
16
|
+
version="0.0.23",
|
|
17
17
|
description="基于Python的懒人包-适用于广告投放模块",
|
|
18
18
|
long_description=long_description,
|
|
19
19
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|