lazyad 0.0.19__tar.gz → 0.0.21__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.19
3
+ Version: 0.0.21
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -248,7 +248,7 @@ def get_plan_list(
248
248
  if not cdt_start_date:
249
249
  cdt_start_date = lazytime.get_date_string(days=-365)
250
250
  if not cdt_end_date:
251
- cdt_end_date = {lazytime.get_date_string(days=0)}
251
+ cdt_end_date = lazytime.get_date_string(days=0)
252
252
  data = {
253
253
  "start_date": start_date,
254
254
  "end_date": end_date,
@@ -307,3 +307,58 @@ def get_plan_list(
307
307
  json=data,
308
308
  headers=headers
309
309
  )
310
+
311
+
312
+ def update_ad_batch(
313
+ cookie,
314
+ media_type: str,
315
+ end_point: str,
316
+ adgroup_id: int = None,
317
+ adgroup_ids: list = None,
318
+ advertiser_id: int = None,
319
+ advertiser_ids: list = None,
320
+ campaign_id: int = None,
321
+ campaign_ids: list = None,
322
+ field: str = "disable"
323
+ ):
324
+ """
325
+ 暂停广告
326
+ :return:
327
+ """
328
+ headers = copy.deepcopy(default_headers)
329
+ headers["Cookie"] = cookie
330
+ if media_type == "gdt_new":
331
+ if end_point == 'updateAdGroupBatch':
332
+ url = "https://cli2.mobgi.com/Gdt/MainList/updateAdGroupBatch"
333
+ if not adgroup_ids:
334
+ adgroup_ids = [adgroup_id]
335
+ if not advertiser_ids:
336
+ advertiser_ids = [advertiser_id]
337
+ post_data = {
338
+ "adgroup_ids": adgroup_ids,
339
+ "advertiser_ids": advertiser_ids,
340
+ "value": "",
341
+ "field": field
342
+ }
343
+ elif end_point == 'updateCampaignBatch':
344
+ url = "https://cli2.mobgi.com/Gdt/MainList/updateCampaignBatch"
345
+ if not campaign_id:
346
+ campaign_ids = [campaign_id]
347
+ if not advertiser_ids:
348
+ advertiser_ids = [advertiser_id]
349
+ post_data = {
350
+ "campaign_ids": campaign_ids,
351
+ "advertiser_ids": advertiser_ids,
352
+ "value": "",
353
+ "field": field
354
+ }
355
+ else:
356
+ return
357
+ else:
358
+ return
359
+ return lazyrequests.lazy_requests(
360
+ method="POST",
361
+ url=url,
362
+ json=post_data,
363
+ headers=headers
364
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.19
3
+ Version: 0.0.21
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -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.19",
16
+ version="0.0.21",
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