lazyad 0.0.67__tar.gz → 0.0.68__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.67 → lazyad-0.0.68}/PKG-INFO +1 -1
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/chuangliang.py +154 -2
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.67 → lazyad-0.0.68}/setup.py +1 -1
- {lazyad-0.0.67 → lazyad-0.0.68}/README.md +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/__init__.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/mintegral.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/crawlers/wshoto.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/open/kuaishou.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/open/mintegral.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/open/qq.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad/open/unity.py +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.67 → lazyad-0.0.68}/setup.cfg +0 -0
|
@@ -227,6 +227,7 @@ def get_plan_list(
|
|
|
227
227
|
kpis: list = None,
|
|
228
228
|
req_source: str = None,
|
|
229
229
|
host: str = default_host,
|
|
230
|
+
base_infos: list = None
|
|
230
231
|
):
|
|
231
232
|
"""
|
|
232
233
|
获取推广计划
|
|
@@ -256,6 +257,23 @@ def get_plan_list(
|
|
|
256
257
|
cdt_start_date = lazytime.get_date_string(days=-365)
|
|
257
258
|
if not cdt_end_date:
|
|
258
259
|
cdt_end_date = lazytime.get_date_string(days=0)
|
|
260
|
+
if not base_infos:
|
|
261
|
+
base_infos = [
|
|
262
|
+
"adgroup_name",
|
|
263
|
+
"adgroup_id",
|
|
264
|
+
"advertiser_id",
|
|
265
|
+
"company",
|
|
266
|
+
"optimization_goal",
|
|
267
|
+
"system_status",
|
|
268
|
+
"bid_amount",
|
|
269
|
+
"deep_conversion_worth_roi",
|
|
270
|
+
"created_time",
|
|
271
|
+
"user_name",
|
|
272
|
+
"daily_budget",
|
|
273
|
+
"bid_mode",
|
|
274
|
+
"deep_conversion_spec",
|
|
275
|
+
"begin_date"
|
|
276
|
+
]
|
|
259
277
|
data = {
|
|
260
278
|
"start_date": start_date,
|
|
261
279
|
"end_date": end_date,
|
|
@@ -263,7 +281,8 @@ def get_plan_list(
|
|
|
263
281
|
"page_size": page_size,
|
|
264
282
|
"sort_field": sort_field,
|
|
265
283
|
"sort_direction": sort_direction,
|
|
266
|
-
"data_type": data_type
|
|
284
|
+
"data_type": data_type,
|
|
285
|
+
"base_infos": base_infos
|
|
267
286
|
}
|
|
268
287
|
if media_type == "baidu":
|
|
269
288
|
url = f"https://{host}/Baidu/Campaign/getList"
|
|
@@ -282,7 +301,7 @@ def get_plan_list(
|
|
|
282
301
|
if media_account_id:
|
|
283
302
|
conditions["media_account_id"] = [media_account_id]
|
|
284
303
|
data["conditions"] = json.dumps(conditions)
|
|
285
|
-
elif media_type
|
|
304
|
+
elif media_type in ["gdt_new"]:
|
|
286
305
|
url = f"https://{host}/Gdt/MainList/getList"
|
|
287
306
|
if not conditions:
|
|
288
307
|
conditions = {
|
|
@@ -994,3 +1013,136 @@ def get_toutiao_promotion(
|
|
|
994
1013
|
json=data,
|
|
995
1014
|
headers=headers
|
|
996
1015
|
)
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
def MainPanelReport_AdReport_getReport(
|
|
1019
|
+
cookie: str,
|
|
1020
|
+
media_type: str,
|
|
1021
|
+
sort_field: str,
|
|
1022
|
+
media_account_id: int = None,
|
|
1023
|
+
page: int = 1,
|
|
1024
|
+
page_size: int = 20,
|
|
1025
|
+
start_date: str = None,
|
|
1026
|
+
end_date: str = None,
|
|
1027
|
+
sort_direction: str = "desc",
|
|
1028
|
+
data_type: str = "list",
|
|
1029
|
+
conditions: dict = None,
|
|
1030
|
+
cdt_start_date: str = None,
|
|
1031
|
+
cdt_end_date: str = None,
|
|
1032
|
+
kpis: list = None,
|
|
1033
|
+
req_source: str = None,
|
|
1034
|
+
|
|
1035
|
+
base_infos: list = None,
|
|
1036
|
+
search_field: str = None,
|
|
1037
|
+
search_keyword: str = None,
|
|
1038
|
+
time_line: str = "REPORTING_TIME",
|
|
1039
|
+
|
|
1040
|
+
scheme: str = "https",
|
|
1041
|
+
host: str = default_host,
|
|
1042
|
+
filename: str = "/MainPanelReport/AdReport/getReport"
|
|
1043
|
+
):
|
|
1044
|
+
"""
|
|
1045
|
+
推广-广告管理-广告
|
|
1046
|
+
:param cookie:
|
|
1047
|
+
:param media_type:
|
|
1048
|
+
:param media_account_id:
|
|
1049
|
+
:param sort_field: 排序字段
|
|
1050
|
+
:param page:
|
|
1051
|
+
:param page_size:
|
|
1052
|
+
:param start_date: 数据开始日期
|
|
1053
|
+
:param end_date: 数据结束日期
|
|
1054
|
+
:param sort_direction: 排序方式,desc:降序
|
|
1055
|
+
:param data_type:
|
|
1056
|
+
:param conditions: 搜索条件
|
|
1057
|
+
:param advertiser_id: 账户id
|
|
1058
|
+
:param cdt_start_date: 创建开始时间
|
|
1059
|
+
:param cdt_end_date: 创建结束时间
|
|
1060
|
+
:param kpis:
|
|
1061
|
+
:param req_source: 腾讯需要的参数
|
|
1062
|
+
:return:
|
|
1063
|
+
"""
|
|
1064
|
+
url = f"{scheme}://{host}{filename}"
|
|
1065
|
+
if not start_date:
|
|
1066
|
+
start_date = lazytime.get_date_string(days=0)
|
|
1067
|
+
if not end_date:
|
|
1068
|
+
end_date = lazytime.get_date_string(days=0)
|
|
1069
|
+
if not cdt_start_date:
|
|
1070
|
+
cdt_start_date = lazytime.get_date_string(days=-365)
|
|
1071
|
+
if not cdt_end_date:
|
|
1072
|
+
cdt_end_date = lazytime.get_date_string(days=0)
|
|
1073
|
+
if not base_infos:
|
|
1074
|
+
base_infos = [
|
|
1075
|
+
"adgroup_name",
|
|
1076
|
+
"adgroup_id",
|
|
1077
|
+
"advertiser_id",
|
|
1078
|
+
"company",
|
|
1079
|
+
"optimization_goal",
|
|
1080
|
+
"system_status",
|
|
1081
|
+
"bid_amount",
|
|
1082
|
+
"deep_conversion_worth_roi",
|
|
1083
|
+
"created_time",
|
|
1084
|
+
"user_name",
|
|
1085
|
+
"daily_budget",
|
|
1086
|
+
"bid_mode",
|
|
1087
|
+
"deep_conversion_spec",
|
|
1088
|
+
"begin_date"
|
|
1089
|
+
]
|
|
1090
|
+
data = {
|
|
1091
|
+
"start_date": start_date,
|
|
1092
|
+
"end_date": end_date,
|
|
1093
|
+
"page": page,
|
|
1094
|
+
"page_size": page_size,
|
|
1095
|
+
"sort_field": sort_field,
|
|
1096
|
+
"sort_direction": sort_direction,
|
|
1097
|
+
"data_type": data_type,
|
|
1098
|
+
"base_infos": base_infos,
|
|
1099
|
+
"time_line": time_line
|
|
1100
|
+
}
|
|
1101
|
+
if media_type == "baidu":
|
|
1102
|
+
if not conditions:
|
|
1103
|
+
conditions = {
|
|
1104
|
+
"cl_project_id": [],
|
|
1105
|
+
"optimize_user_id": [],
|
|
1106
|
+
"media_account_id": [],
|
|
1107
|
+
"extension_subject": [],
|
|
1108
|
+
"status": "",
|
|
1109
|
+
"keyword": "",
|
|
1110
|
+
"companys": [],
|
|
1111
|
+
"cdt_start_date": f"{cdt_start_date} 00:00:00",
|
|
1112
|
+
"cdt_end_date": f"{cdt_end_date} 23:59:59"
|
|
1113
|
+
}
|
|
1114
|
+
if media_account_id:
|
|
1115
|
+
conditions["media_account_id"] = [media_account_id]
|
|
1116
|
+
data["conditions"] = json.dumps(conditions)
|
|
1117
|
+
elif media_type in ["gdt_new", "gdt_upgrade"]:
|
|
1118
|
+
if not conditions:
|
|
1119
|
+
conditions = {
|
|
1120
|
+
"is_deleted": "",
|
|
1121
|
+
"auto_acquisition_status": [],
|
|
1122
|
+
"combinatorial_id": [],
|
|
1123
|
+
"companys": [],
|
|
1124
|
+
"configured_status": ["STATUS_NO_DELETED"], # 所有未删除
|
|
1125
|
+
"created_time": [cdt_start_date, cdt_end_date],
|
|
1126
|
+
"last_modified_time": [],
|
|
1127
|
+
"media_project_id": [],
|
|
1128
|
+
"owner_user_id": [],
|
|
1129
|
+
"search_field": search_field,
|
|
1130
|
+
"search_keyword": search_keyword,
|
|
1131
|
+
"system_status": [],
|
|
1132
|
+
"time_line": time_line,
|
|
1133
|
+
}
|
|
1134
|
+
data["conditions"] = json.dumps(conditions)
|
|
1135
|
+
if kpis:
|
|
1136
|
+
data["kpis"] = kpis
|
|
1137
|
+
if req_source:
|
|
1138
|
+
data["req_source"] = req_source
|
|
1139
|
+
else:
|
|
1140
|
+
return
|
|
1141
|
+
headers = copy.deepcopy(default_headers)
|
|
1142
|
+
headers["Cookie"] = cookie
|
|
1143
|
+
return lazyrequests.lazy_requests(
|
|
1144
|
+
method="POST",
|
|
1145
|
+
url=url,
|
|
1146
|
+
json=data,
|
|
1147
|
+
headers=headers
|
|
1148
|
+
)
|
|
@@ -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.68",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|