lazyad 0.0.66__py3-none-any.whl → 0.0.68__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 +159 -5
- {lazyad-0.0.66.dist-info → lazyad-0.0.68.dist-info}/METADATA +1 -1
- {lazyad-0.0.66.dist-info → lazyad-0.0.68.dist-info}/RECORD +5 -5
- {lazyad-0.0.66.dist-info → lazyad-0.0.68.dist-info}/WHEEL +0 -0
- {lazyad-0.0.66.dist-info → lazyad-0.0.68.dist-info}/top_level.txt +0 -0
lazyad/crawlers/chuangliang.py
CHANGED
|
@@ -77,6 +77,7 @@ def get_ad_report(
|
|
|
77
77
|
kpis: list = None,
|
|
78
78
|
relate_dims: list = None,
|
|
79
79
|
host: str = default_host,
|
|
80
|
+
db_type: str = "doris"
|
|
80
81
|
):
|
|
81
82
|
"""
|
|
82
83
|
报表-广告报表
|
|
@@ -112,6 +113,7 @@ def get_ad_report(
|
|
|
112
113
|
"data_dim": data_dim,
|
|
113
114
|
"sort_field": sort_field,
|
|
114
115
|
"sort_direction": sort_direction,
|
|
116
|
+
"db_type": db_type
|
|
115
117
|
}
|
|
116
118
|
if media_type == "baidu":
|
|
117
119
|
if not conditions:
|
|
@@ -134,7 +136,7 @@ def get_ad_report(
|
|
|
134
136
|
if not relate_dims:
|
|
135
137
|
relate_dims = ["advertiser_id"]
|
|
136
138
|
|
|
137
|
-
elif media_type
|
|
139
|
+
elif media_type in ["gdt_new", "gdt_upgrade"]:
|
|
138
140
|
if not conditions:
|
|
139
141
|
conditions = {
|
|
140
142
|
"keyword": "",
|
|
@@ -191,8 +193,8 @@ def get_ad_report(
|
|
|
191
193
|
relate_dims = ["advertiser_id"]
|
|
192
194
|
|
|
193
195
|
else:
|
|
194
|
-
showlog.warning("
|
|
195
|
-
|
|
196
|
+
showlog.warning("未知媒体类型,不指定默认参数")
|
|
197
|
+
pass
|
|
196
198
|
|
|
197
199
|
headers = copy.deepcopy(default_headers)
|
|
198
200
|
headers["Cookie"] = cookie
|
|
@@ -225,6 +227,7 @@ def get_plan_list(
|
|
|
225
227
|
kpis: list = None,
|
|
226
228
|
req_source: str = None,
|
|
227
229
|
host: str = default_host,
|
|
230
|
+
base_infos: list = None
|
|
228
231
|
):
|
|
229
232
|
"""
|
|
230
233
|
获取推广计划
|
|
@@ -254,6 +257,23 @@ def get_plan_list(
|
|
|
254
257
|
cdt_start_date = lazytime.get_date_string(days=-365)
|
|
255
258
|
if not cdt_end_date:
|
|
256
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
|
+
]
|
|
257
277
|
data = {
|
|
258
278
|
"start_date": start_date,
|
|
259
279
|
"end_date": end_date,
|
|
@@ -261,7 +281,8 @@ def get_plan_list(
|
|
|
261
281
|
"page_size": page_size,
|
|
262
282
|
"sort_field": sort_field,
|
|
263
283
|
"sort_direction": sort_direction,
|
|
264
|
-
"data_type": data_type
|
|
284
|
+
"data_type": data_type,
|
|
285
|
+
"base_infos": base_infos
|
|
265
286
|
}
|
|
266
287
|
if media_type == "baidu":
|
|
267
288
|
url = f"https://{host}/Baidu/Campaign/getList"
|
|
@@ -280,7 +301,7 @@ def get_plan_list(
|
|
|
280
301
|
if media_account_id:
|
|
281
302
|
conditions["media_account_id"] = [media_account_id]
|
|
282
303
|
data["conditions"] = json.dumps(conditions)
|
|
283
|
-
elif media_type
|
|
304
|
+
elif media_type in ["gdt_new"]:
|
|
284
305
|
url = f"https://{host}/Gdt/MainList/getList"
|
|
285
306
|
if not conditions:
|
|
286
307
|
conditions = {
|
|
@@ -992,3 +1013,136 @@ def get_toutiao_promotion(
|
|
|
992
1013
|
json=data,
|
|
993
1014
|
headers=headers
|
|
994
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
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
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=EyES5S0Z5THbqYboDzR6np0BC36Zkwn5CsU8_K2HbNI,33293
|
|
4
4
|
lazyad/crawlers/mintegral.py,sha256=FNd9CAZd0x_jZdrSKunODYGJJb6EJofmq0kQzSDu2Yg,11154
|
|
5
5
|
lazyad/crawlers/oceanengine.py,sha256=kjBEpCb_h5OpodCTqzvXd5MBBwAuw3Oq5UKWoTCXrQM,4540
|
|
6
6
|
lazyad/crawlers/qq.py,sha256=X_VjdgzAcDfckEAHrvdqBLtnmAuCBHPJVWu2H-IHZBA,5649
|
|
@@ -10,7 +10,7 @@ lazyad/open/kuaishou.py,sha256=B4wz3XW1hLQy7XR_nDQwrMUrYnm9Djec7OXKXRdiYXc,635
|
|
|
10
10
|
lazyad/open/mintegral.py,sha256=BXCaCfnz2iUsR-RtDSA8I27KSK8r4v3xkZfllD9q_vY,12788
|
|
11
11
|
lazyad/open/qq.py,sha256=pru1p4LCjURD9N5ukx-OStYAmDCvrTW4VMB2N0-3i5Q,6904
|
|
12
12
|
lazyad/open/unity.py,sha256=A0tEN5k40xq0v1cRnTLwRN5N7CBIe2oAyMRH1uxDAEw,8493
|
|
13
|
-
lazyad-0.0.
|
|
14
|
-
lazyad-0.0.
|
|
15
|
-
lazyad-0.0.
|
|
16
|
-
lazyad-0.0.
|
|
13
|
+
lazyad-0.0.68.dist-info/METADATA,sha256=RY0eVCVSvvSb0k6xqYT-G7kRJ3_wlBaMbgZbS0Dqnb4,1916
|
|
14
|
+
lazyad-0.0.68.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
15
|
+
lazyad-0.0.68.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
|
|
16
|
+
lazyad-0.0.68.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|