lazyad 0.0.65__py3-none-any.whl → 0.0.67__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.

@@ -28,7 +28,8 @@ def get_media_account(
28
28
  cookie: str = None,
29
29
  page: int = 1,
30
30
  page_size: int = 20,
31
- total_count: int = 0
31
+ total_count: int = 0,
32
+ host: str = default_host,
32
33
  ):
33
34
  """
34
35
  获取 推广-账户管理下的账户列表
@@ -40,7 +41,7 @@ def get_media_account(
40
41
  :return:
41
42
  """
42
43
 
43
- url = 'https://cli2.mobgi.com/Media/Account/getList'
44
+ url = f'https://{host}/Media/Account/getList'
44
45
  data = {
45
46
  "media_type": media_type,
46
47
  "advertiser_type": "1",
@@ -75,6 +76,8 @@ def get_ad_report(
75
76
  conditions: dict = None,
76
77
  kpis: list = None,
77
78
  relate_dims: list = None,
79
+ host: str = default_host,
80
+ db_type: str = "doris"
78
81
  ):
79
82
  """
80
83
  报表-广告报表
@@ -98,7 +101,7 @@ def get_ad_report(
98
101
  start_date = lazytime.get_date_string(days=0)
99
102
  if not end_date:
100
103
  end_date = lazytime.get_date_string(days=0)
101
- url = "https://cli2.mobgi.com/ReportV23/AdReport/getReport"
104
+ url = f"https://{host}/ReportV23/AdReport/getReport"
102
105
  data = {
103
106
  "start_date": start_date,
104
107
  "end_date": end_date,
@@ -110,6 +113,7 @@ def get_ad_report(
110
113
  "data_dim": data_dim,
111
114
  "sort_field": sort_field,
112
115
  "sort_direction": sort_direction,
116
+ "db_type": db_type
113
117
  }
114
118
  if media_type == "baidu":
115
119
  if not conditions:
@@ -132,7 +136,7 @@ def get_ad_report(
132
136
  if not relate_dims:
133
137
  relate_dims = ["advertiser_id"]
134
138
 
135
- elif media_type == "gdt_new":
139
+ elif media_type in ["gdt_new", "gdt_upgrade"]:
136
140
  if not conditions:
137
141
  conditions = {
138
142
  "keyword": "",
@@ -189,8 +193,8 @@ def get_ad_report(
189
193
  relate_dims = ["advertiser_id"]
190
194
 
191
195
  else:
192
- showlog.warning("未知媒体类型")
193
- return
196
+ showlog.warning("未知媒体类型,不指定默认参数")
197
+ pass
194
198
 
195
199
  headers = copy.deepcopy(default_headers)
196
200
  headers["Cookie"] = cookie
@@ -221,7 +225,8 @@ def get_plan_list(
221
225
  cdt_start_date: str = None,
222
226
  cdt_end_date: str = None,
223
227
  kpis: list = None,
224
- req_source: str = None
228
+ req_source: str = None,
229
+ host: str = default_host,
225
230
  ):
226
231
  """
227
232
  获取推广计划
@@ -261,7 +266,7 @@ def get_plan_list(
261
266
  "data_type": data_type
262
267
  }
263
268
  if media_type == "baidu":
264
- url = "https://cli2.mobgi.com/Baidu/Campaign/getList"
269
+ url = f"https://{host}/Baidu/Campaign/getList"
265
270
  if not conditions:
266
271
  conditions = {
267
272
  "cl_project_id": [],
@@ -278,7 +283,7 @@ def get_plan_list(
278
283
  conditions["media_account_id"] = [media_account_id]
279
284
  data["conditions"] = json.dumps(conditions)
280
285
  elif media_type == "gdt_new":
281
- url = "https://cli2.mobgi.com/Gdt/MainList/getList"
286
+ url = f"https://{host}/Gdt/MainList/getList"
282
287
  if not conditions:
283
288
  conditions = {
284
289
  "is_deleted": "",
@@ -333,7 +338,8 @@ def update_ad_batch(
333
338
  campaign_feed_id: int = None,
334
339
  campaign_feed_ids: list = None,
335
340
 
336
- operate: str = "disable"
341
+ operate: str = "disable",
342
+ host: str = default_host
337
343
  ):
338
344
  """
339
345
  暂停广告
@@ -350,12 +356,12 @@ def update_ad_batch(
350
356
  "field": operate
351
357
  }
352
358
  if adgroup_id or adgroup_ids:
353
- url = "https://cli2.mobgi.com/Gdt/MainList/updateAdGroupBatch"
359
+ url = f"https://{host}/Gdt/MainList/updateAdGroupBatch"
354
360
  if not adgroup_ids:
355
361
  adgroup_ids = [adgroup_id]
356
362
  post_data["adgroup_ids"] = adgroup_ids
357
363
  elif campaign_id or campaign_ids:
358
- url = "https://cli2.mobgi.com/Gdt/MainList/updateCampaignBatch"
364
+ url = f"https://{host}/Gdt/MainList/updateCampaignBatch"
359
365
  if campaign_id and not campaign_ids:
360
366
  campaign_ids = [campaign_id]
361
367
  post_data["campaign_ids"] = campaign_ids
@@ -364,7 +370,7 @@ def update_ad_batch(
364
370
 
365
371
  elif media_type == "baidu":
366
372
  if adgroup_feed_id or adgroup_feed_ids:
367
- url = "https://cli2.mobgi.com/Baidu/AdGroup/batchUpdate"
373
+ url = f"https://{host}/Baidu/AdGroup/batchUpdate"
368
374
  if adgroup_feed_id and not adgroup_feed_ids:
369
375
  adgroup_feed_ids = [adgroup_feed_id]
370
376
  post_data = {
@@ -372,7 +378,7 @@ def update_ad_batch(
372
378
  "opt_status": operate
373
379
  }
374
380
  elif campaign_feed_id or campaign_feed_ids:
375
- url = "https://cli2.mobgi.com/Baidu/Campaign/batchUpdate"
381
+ url = f"https://{host}/Baidu/Campaign/batchUpdate"
376
382
  if campaign_feed_id and not campaign_feed_ids:
377
383
  campaign_feed_ids = [campaign_feed_id]
378
384
  post_data = {
@@ -382,7 +388,7 @@ def update_ad_batch(
382
388
  else:
383
389
  return
384
390
  elif media_type == "toutiao_upgrade":
385
- url = "https://cli2.mobgi.com/Toutiao/Promotion/updateStatus"
391
+ url = f"https://{host}/Toutiao/Promotion/updateStatus"
386
392
  if promotion_id and not promotion_ids:
387
393
  promotion_ids = [promotion_id]
388
394
  post_data = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.65
3
+ Version: 0.0.67
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -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=b5XEnGUCXunAuyda0_1R7Mf8jpBacCEfoktZuJVTzWg,28505
3
+ lazyad/crawlers/chuangliang.py,sha256=leg3mfaS0obd3OZ3e5PnBFLd9M3ln8wF0kfOcVOlnnM,28677
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.65.dist-info/METADATA,sha256=bMio1-q7O0FUREZI8e93Py5r20mXrT58e4wF4-R48HY,1916
14
- lazyad-0.0.65.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
15
- lazyad-0.0.65.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
16
- lazyad-0.0.65.dist-info/RECORD,,
13
+ lazyad-0.0.67.dist-info/METADATA,sha256=LebzW06KFu0W9_N6rjl2CqP6ckqTtU21vPDOwMA2Sok,1916
14
+ lazyad-0.0.67.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
15
+ lazyad-0.0.67.dist-info/top_level.txt,sha256=RAPjtj4gZYpsKAM3fAQrWyyn84xjdRuaiUS76gx6eNs,7
16
+ lazyad-0.0.67.dist-info/RECORD,,