lazyad 0.0.16__py3-none-any.whl → 0.0.18__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 +105 -2
- {lazyad-0.0.16.dist-info → lazyad-0.0.18.dist-info}/METADATA +1 -1
- {lazyad-0.0.16.dist-info → lazyad-0.0.18.dist-info}/RECORD +5 -5
- {lazyad-0.0.16.dist-info → lazyad-0.0.18.dist-info}/WHEEL +0 -0
- {lazyad-0.0.16.dist-info → lazyad-0.0.18.dist-info}/top_level.txt +0 -0
lazyad/crawlers/chuangliang.py
CHANGED
|
@@ -2,6 +2,7 @@ from lazysdk import lazyrequests
|
|
|
2
2
|
from lazysdk import lazytime
|
|
3
3
|
import showlog
|
|
4
4
|
import copy
|
|
5
|
+
import json
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
default_headers = {
|
|
@@ -59,11 +60,11 @@ def get_media_account(
|
|
|
59
60
|
|
|
60
61
|
def get_ad_report(
|
|
61
62
|
cookie: str,
|
|
63
|
+
media_type: str,
|
|
62
64
|
start_date: str = None,
|
|
63
65
|
end_date: str = None,
|
|
64
66
|
page: int = 1,
|
|
65
67
|
page_size: int = 20,
|
|
66
|
-
media_type: str = "gdt_new",
|
|
67
68
|
sort_field: str = "cost",
|
|
68
69
|
time_dim: str = "sum",
|
|
69
70
|
sort_direction: str = "desc",
|
|
@@ -84,7 +85,7 @@ def get_ad_report(
|
|
|
84
85
|
:param sort_field: 排序字段
|
|
85
86
|
:param time_dim: 数据的时间维度汇总方式
|
|
86
87
|
:param sort_direction: 排序方式,desc降序
|
|
87
|
-
:param data_dim: 数据维度,ad
|
|
88
|
+
:param data_dim: 数据维度,advertiser_id:账户,ad:广告
|
|
88
89
|
:param data_type:
|
|
89
90
|
:param conditions: 搜索条件
|
|
90
91
|
:param kpis: 需要获取的字段
|
|
@@ -200,3 +201,105 @@ def get_ad_report(
|
|
|
200
201
|
json=data,
|
|
201
202
|
headers=headers
|
|
202
203
|
)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def get_plan_list(
|
|
207
|
+
cookie: str,
|
|
208
|
+
media_type: str,
|
|
209
|
+
sort_field: str,
|
|
210
|
+
media_account_id: int = None,
|
|
211
|
+
page: int = 1,
|
|
212
|
+
page_size: int = 20,
|
|
213
|
+
start_date: str = None,
|
|
214
|
+
end_date: str = None,
|
|
215
|
+
sort_direction: str = "desc",
|
|
216
|
+
data_type: str = "list",
|
|
217
|
+
conditions: dict = None,
|
|
218
|
+
advertiser_id: int = None,
|
|
219
|
+
cdt_start_date: str = None,
|
|
220
|
+
cdt_end_date: str = None,
|
|
221
|
+
kpis: list = None
|
|
222
|
+
):
|
|
223
|
+
"""
|
|
224
|
+
获取推广计划
|
|
225
|
+
:param cookie:
|
|
226
|
+
:param media_type:
|
|
227
|
+
:param media_account_id:
|
|
228
|
+
:param sort_field: 排序字段
|
|
229
|
+
:param page:
|
|
230
|
+
:param page_size:
|
|
231
|
+
:param start_date: 数据开始日期
|
|
232
|
+
:param end_date: 数据结束日期
|
|
233
|
+
:param sort_direction: 排序方式,desc:降序
|
|
234
|
+
:param data_type:
|
|
235
|
+
:param conditions: 搜索条件
|
|
236
|
+
:param advertiser_id: 账户id
|
|
237
|
+
:param cdt_start_date: 创建开始时间
|
|
238
|
+
:param cdt_end_date: 创建结束时间
|
|
239
|
+
:param kpis:
|
|
240
|
+
:return:
|
|
241
|
+
"""
|
|
242
|
+
if not start_date:
|
|
243
|
+
start_date = lazytime.get_date_string(days=0)
|
|
244
|
+
if not end_date:
|
|
245
|
+
end_date = lazytime.get_date_string(days=0)
|
|
246
|
+
if not cdt_start_date:
|
|
247
|
+
cdt_start_date = lazytime.get_date_string(days=-365)
|
|
248
|
+
if not cdt_end_date:
|
|
249
|
+
cdt_end_date = {lazytime.get_date_string(days=0)}
|
|
250
|
+
data = {
|
|
251
|
+
"start_date": start_date,
|
|
252
|
+
"end_date": end_date,
|
|
253
|
+
"page": page,
|
|
254
|
+
"page_size": page_size,
|
|
255
|
+
"sort_field": sort_field,
|
|
256
|
+
"sort_direction": sort_direction,
|
|
257
|
+
"data_type": data_type
|
|
258
|
+
}
|
|
259
|
+
if media_type == "baidu":
|
|
260
|
+
url = "https://cli2.mobgi.com/Baidu/Campaign/getList"
|
|
261
|
+
if not conditions:
|
|
262
|
+
conditions = {
|
|
263
|
+
"cl_project_id": [],
|
|
264
|
+
"optimize_user_id": [],
|
|
265
|
+
"media_account_id": [],
|
|
266
|
+
"extension_subject": [],
|
|
267
|
+
"status": "",
|
|
268
|
+
"keyword": "",
|
|
269
|
+
"companys": [],
|
|
270
|
+
"cdt_start_date": f"{cdt_start_date} 00:00:00",
|
|
271
|
+
"cdt_end_date": f"{cdt_end_date} 23:59:59"
|
|
272
|
+
}
|
|
273
|
+
if media_account_id:
|
|
274
|
+
conditions["media_account_id"] = [media_account_id]
|
|
275
|
+
data["conditions"] = json.dumps(conditions)
|
|
276
|
+
elif media_type == "gdt_new":
|
|
277
|
+
url = "https://cli2.mobgi.com/Gdt/MainList/getList"
|
|
278
|
+
if not conditions:
|
|
279
|
+
conditions = {
|
|
280
|
+
"is_deleted": "",
|
|
281
|
+
"project_id": [],
|
|
282
|
+
"advertiser_id": [],
|
|
283
|
+
"user_id": [],
|
|
284
|
+
"configured_status": [],
|
|
285
|
+
"keyword": "",
|
|
286
|
+
"companys": [],
|
|
287
|
+
"time_line": "REPORTING_TIME",
|
|
288
|
+
"cdt_start_date": f"{cdt_start_date} 00:00:00",
|
|
289
|
+
"cdt_end_date": f"{cdt_end_date} 23:59:59"
|
|
290
|
+
}
|
|
291
|
+
if advertiser_id:
|
|
292
|
+
conditions["advertiser_id"] = [advertiser_id]
|
|
293
|
+
data["conditions"] = json.dumps(conditions)
|
|
294
|
+
if kpis:
|
|
295
|
+
data["kpis"] = kpis
|
|
296
|
+
else:
|
|
297
|
+
return
|
|
298
|
+
headers = copy.deepcopy(default_headers)
|
|
299
|
+
headers["Cookie"] = cookie
|
|
300
|
+
return lazyrequests.lazy_requests(
|
|
301
|
+
method="POST",
|
|
302
|
+
url=url,
|
|
303
|
+
json=data,
|
|
304
|
+
headers=headers
|
|
305
|
+
)
|
|
@@ -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=5944ro4Vy0EadiPvcIAr4_R8mSOWh5Nq36PR1VqIJtw,9311
|
|
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.18.dist-info/METADATA,sha256=K04xncD4l3HCijb6ZQsKkM6hutpBowUwq0nXx7SD2s4,1695
|
|
9
|
+
lazyad-0.0.18.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
10
|
+
lazyad-0.0.18.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
|
|
11
|
+
lazyad-0.0.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|