lazyad 0.0.30__tar.gz → 0.0.32__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.30 → lazyad-0.0.32}/PKG-INFO +1 -1
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/crawlers/chuangliang.py +130 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.30 → lazyad-0.0.32}/setup.py +1 -1
- {lazyad-0.0.30 → lazyad-0.0.32}/README.md +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/__init__.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad/open/qq.py +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.30 → lazyad-0.0.32}/setup.cfg +0 -0
|
@@ -557,3 +557,133 @@ def get_material_report(
|
|
|
557
557
|
json=data,
|
|
558
558
|
headers=headers
|
|
559
559
|
)
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
def get_account_report(
|
|
563
|
+
cookie: str,
|
|
564
|
+
media_type: str,
|
|
565
|
+
start_date: str = None,
|
|
566
|
+
end_date: str = None,
|
|
567
|
+
page: int = 1,
|
|
568
|
+
page_size: int = 20,
|
|
569
|
+
sort_field: str = "cost",
|
|
570
|
+
sort_direction: str = "desc",
|
|
571
|
+
data_type: str = "list",
|
|
572
|
+
conditions: dict = None,
|
|
573
|
+
kpis: list = None,
|
|
574
|
+
base_infos: list = None,
|
|
575
|
+
time_line: str = "REPORTING_TIME"
|
|
576
|
+
):
|
|
577
|
+
"""
|
|
578
|
+
推广-广告管理-媒体账户
|
|
579
|
+
:param cookie:
|
|
580
|
+
:param start_date: 数据开始日期,默认为当日
|
|
581
|
+
:param end_date: 数据结束日期,默认为当日
|
|
582
|
+
:param page: 页码
|
|
583
|
+
:param page_size: 每页数量
|
|
584
|
+
:param media_type: 媒体:gdt_upgrade|腾讯广告3.0,
|
|
585
|
+
:param sort_field: 排序字段
|
|
586
|
+
:param sort_direction: 排序方式,desc降序
|
|
587
|
+
:param data_type:
|
|
588
|
+
:param conditions: 搜索条件
|
|
589
|
+
:param kpis: 需要获取的字段
|
|
590
|
+
:return:
|
|
591
|
+
"""
|
|
592
|
+
if not start_date:
|
|
593
|
+
start_date = lazytime.get_date_string(days=0)
|
|
594
|
+
if not end_date:
|
|
595
|
+
end_date = lazytime.get_date_string(days=0)
|
|
596
|
+
url = "https://cli2.mobgi.com/MainPanelReport/AccountReport/getReport"
|
|
597
|
+
data = {
|
|
598
|
+
"data_type": data_type,
|
|
599
|
+
"media_type": media_type,
|
|
600
|
+
"sort_field": sort_field,
|
|
601
|
+
"sort_direction": sort_direction,
|
|
602
|
+
"page": page,
|
|
603
|
+
"page_size": page_size,
|
|
604
|
+
"start_date": start_date,
|
|
605
|
+
"end_date": end_date,
|
|
606
|
+
"time_line": time_line
|
|
607
|
+
}
|
|
608
|
+
if media_type == "gdt_upgrade":
|
|
609
|
+
if not conditions:
|
|
610
|
+
conditions = {
|
|
611
|
+
"keyword": "",
|
|
612
|
+
"owner_user_id": [],
|
|
613
|
+
"company": [],
|
|
614
|
+
"media_project_id": [],
|
|
615
|
+
"balance": "",
|
|
616
|
+
"time_line": "REPORTING_TIME"
|
|
617
|
+
}
|
|
618
|
+
if not kpis:
|
|
619
|
+
kpis = [
|
|
620
|
+
"cost",
|
|
621
|
+
"thousand_display_price",
|
|
622
|
+
"cpc",
|
|
623
|
+
"conversions_count",
|
|
624
|
+
"conversions_cost",
|
|
625
|
+
"from_follow_uv",
|
|
626
|
+
"from_follow_cost",
|
|
627
|
+
"cheout_fd"
|
|
628
|
+
]
|
|
629
|
+
if not base_infos:
|
|
630
|
+
base_infos = [
|
|
631
|
+
"advertiser_id",
|
|
632
|
+
"advertiser_nick",
|
|
633
|
+
"user_name",
|
|
634
|
+
"advertiser_name",
|
|
635
|
+
"balance",
|
|
636
|
+
"daily_budget"
|
|
637
|
+
]
|
|
638
|
+
else:
|
|
639
|
+
showlog.warning("未知媒体类型")
|
|
640
|
+
return
|
|
641
|
+
|
|
642
|
+
headers = copy.deepcopy(default_headers)
|
|
643
|
+
headers["Cookie"] = cookie
|
|
644
|
+
data["conditions"] = conditions
|
|
645
|
+
data["kpis"] = kpis
|
|
646
|
+
data["base_infos"] = base_infos
|
|
647
|
+
return lazyrequests.lazy_requests(
|
|
648
|
+
method="POST",
|
|
649
|
+
url=url,
|
|
650
|
+
json=data,
|
|
651
|
+
headers=headers
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
def update_budget_batch(
|
|
656
|
+
cookie: str,
|
|
657
|
+
media_type: str,
|
|
658
|
+
media_account_id: str = None,
|
|
659
|
+
daily_budget: str = None
|
|
660
|
+
):
|
|
661
|
+
"""
|
|
662
|
+
修改账户日预算
|
|
663
|
+
:param cookie:
|
|
664
|
+
:return:
|
|
665
|
+
"""
|
|
666
|
+
if media_type == "gdt":
|
|
667
|
+
# 目前只有旧版可以改,新版的无法改
|
|
668
|
+
url = "https://cli2.mobgi.com/Gdt/MainList/updateBudgetBatch"
|
|
669
|
+
data = {
|
|
670
|
+
"data": [
|
|
671
|
+
{
|
|
672
|
+
"media_account_id": media_account_id,
|
|
673
|
+
"daily_budget": daily_budget
|
|
674
|
+
}
|
|
675
|
+
],
|
|
676
|
+
"time": "now"
|
|
677
|
+
}
|
|
678
|
+
else:
|
|
679
|
+
showlog.warning("未知媒体类型")
|
|
680
|
+
return
|
|
681
|
+
|
|
682
|
+
headers = copy.deepcopy(default_headers)
|
|
683
|
+
headers["Cookie"] = cookie
|
|
684
|
+
return lazyrequests.lazy_requests(
|
|
685
|
+
method="POST",
|
|
686
|
+
url=url,
|
|
687
|
+
json=data,
|
|
688
|
+
headers=headers
|
|
689
|
+
)
|
|
@@ -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.32",
|
|
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
|