lazyad 0.0.64__tar.gz → 0.0.66__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.64
3
+ Version: 0.0.66
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -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,7 @@ 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,
78
80
  ):
79
81
  """
80
82
  报表-广告报表
@@ -98,7 +100,7 @@ def get_ad_report(
98
100
  start_date = lazytime.get_date_string(days=0)
99
101
  if not end_date:
100
102
  end_date = lazytime.get_date_string(days=0)
101
- url = "https://cli2.mobgi.com/ReportV23/AdReport/getReport"
103
+ url = f"https://{host}/ReportV23/AdReport/getReport"
102
104
  data = {
103
105
  "start_date": start_date,
104
106
  "end_date": end_date,
@@ -221,7 +223,8 @@ def get_plan_list(
221
223
  cdt_start_date: str = None,
222
224
  cdt_end_date: str = None,
223
225
  kpis: list = None,
224
- req_source: str = None
226
+ req_source: str = None,
227
+ host: str = default_host,
225
228
  ):
226
229
  """
227
230
  获取推广计划
@@ -261,7 +264,7 @@ def get_plan_list(
261
264
  "data_type": data_type
262
265
  }
263
266
  if media_type == "baidu":
264
- url = "https://cli2.mobgi.com/Baidu/Campaign/getList"
267
+ url = f"https://{host}/Baidu/Campaign/getList"
265
268
  if not conditions:
266
269
  conditions = {
267
270
  "cl_project_id": [],
@@ -278,7 +281,7 @@ def get_plan_list(
278
281
  conditions["media_account_id"] = [media_account_id]
279
282
  data["conditions"] = json.dumps(conditions)
280
283
  elif media_type == "gdt_new":
281
- url = "https://cli2.mobgi.com/Gdt/MainList/getList"
284
+ url = f"https://{host}/Gdt/MainList/getList"
282
285
  if not conditions:
283
286
  conditions = {
284
287
  "is_deleted": "",
@@ -333,7 +336,8 @@ def update_ad_batch(
333
336
  campaign_feed_id: int = None,
334
337
  campaign_feed_ids: list = None,
335
338
 
336
- operate: str = "disable"
339
+ operate: str = "disable",
340
+ host: str = default_host
337
341
  ):
338
342
  """
339
343
  暂停广告
@@ -350,12 +354,12 @@ def update_ad_batch(
350
354
  "field": operate
351
355
  }
352
356
  if adgroup_id or adgroup_ids:
353
- url = "https://cli2.mobgi.com/Gdt/MainList/updateAdGroupBatch"
357
+ url = f"https://{host}/Gdt/MainList/updateAdGroupBatch"
354
358
  if not adgroup_ids:
355
359
  adgroup_ids = [adgroup_id]
356
360
  post_data["adgroup_ids"] = adgroup_ids
357
361
  elif campaign_id or campaign_ids:
358
- url = "https://cli2.mobgi.com/Gdt/MainList/updateCampaignBatch"
362
+ url = f"https://{host}/Gdt/MainList/updateCampaignBatch"
359
363
  if campaign_id and not campaign_ids:
360
364
  campaign_ids = [campaign_id]
361
365
  post_data["campaign_ids"] = campaign_ids
@@ -364,7 +368,7 @@ def update_ad_batch(
364
368
 
365
369
  elif media_type == "baidu":
366
370
  if adgroup_feed_id or adgroup_feed_ids:
367
- url = "https://cli2.mobgi.com/Baidu/AdGroup/batchUpdate"
371
+ url = f"https://{host}/Baidu/AdGroup/batchUpdate"
368
372
  if adgroup_feed_id and not adgroup_feed_ids:
369
373
  adgroup_feed_ids = [adgroup_feed_id]
370
374
  post_data = {
@@ -372,7 +376,7 @@ def update_ad_batch(
372
376
  "opt_status": operate
373
377
  }
374
378
  elif campaign_feed_id or campaign_feed_ids:
375
- url = "https://cli2.mobgi.com/Baidu/Campaign/batchUpdate"
379
+ url = f"https://{host}/Baidu/Campaign/batchUpdate"
376
380
  if campaign_feed_id and not campaign_feed_ids:
377
381
  campaign_feed_ids = [campaign_feed_id]
378
382
  post_data = {
@@ -382,7 +386,7 @@ def update_ad_batch(
382
386
  else:
383
387
  return
384
388
  elif media_type == "toutiao_upgrade":
385
- url = "https://cli2.mobgi.com/Toutiao/Promotion/updateStatus"
389
+ url = f"https://{host}/Toutiao/Promotion/updateStatus"
386
390
  if promotion_id and not promotion_ids:
387
391
  promotion_ids = [promotion_id]
388
392
  post_data = {
@@ -905,3 +909,86 @@ def deactivate_material(
905
909
  json=data,
906
910
  headers=headers
907
911
  )
912
+
913
+
914
+ def get_toutiao_promotion(
915
+ cookie: str,
916
+ user_id: list = None,
917
+ material_id: str = None,
918
+ cdt_start_date: str = None,
919
+ cdt_end_date: str = None,
920
+ start_date: str = None,
921
+ end_date: str = None,
922
+ host: str = default_host,
923
+ page: int = 1,
924
+ page_size: int = 20,
925
+ sort_field: str = "create_time",
926
+ sort_direction: str = "desc",
927
+ data_type: str = "list"
928
+ ):
929
+ """
930
+ 推广-巨量广告-广告 查询
931
+ :param cookie:
932
+ :param material_id: 素材ID
933
+ :param cdt_start_date: 创建时间,例如:2025-07-05 00:00:00
934
+ :param cdt_end_date: 创建时间,例如:2025-08-04 23:59:59
935
+ :param start_date: 数据日期,例如:2025-08-04
936
+ :param end_date: 数据日期,例如:2025-08-04
937
+ :param host:
938
+ :return:
939
+ """
940
+ url = f"https://{host}/Toutiao/Promotion/getList"
941
+ if not user_id:
942
+ user_id = []
943
+ conditions = {
944
+ "search_field":"promotion_name",
945
+ "search_keyword":"",
946
+ "cl_project_id":[],
947
+ "cl_app_id":[],
948
+ "user_id": user_id,
949
+ "media_account_id":[],
950
+ "companys":[],
951
+ "landing_type":"",
952
+ "delivery_mode":"",
953
+ "project_id":[],
954
+ "status_first":"",
955
+ "scene_type":[],
956
+ "strategy_id":[],
957
+ "ad_type":"",
958
+ "learning_phase":[],
959
+ "star_delivery_type":"",
960
+ "star_task_id":"",
961
+ "app_type":"",
962
+ "external_action":[],
963
+ "deep_external_action":[],
964
+ "deep_bid_type":[],
965
+ "material_id": material_id,
966
+ "search_type":"like",
967
+ "combinatorial_id":"",
968
+ "status":"",
969
+ "status_second":"",
970
+ "cdt_start_date": cdt_start_date,
971
+ "cdt_end_date": cdt_end_date
972
+ }
973
+ data = {
974
+ "conditions": json.dumps(conditions),
975
+ "start_date": start_date,
976
+ "end_date": end_date,
977
+ "page": page,
978
+ "page_size": page_size,
979
+ # "total_count": 1,
980
+ # "total_page": 1,
981
+ "sort_field": sort_field,
982
+ "sort_direction": sort_direction,
983
+ "data_type": data_type
984
+ }
985
+ headers = copy.deepcopy(default_headers)
986
+ headers["Cookie"] = cookie
987
+ if host:
988
+ headers["Host"] = host
989
+ return lazyrequests.lazy_requests(
990
+ method="POST",
991
+ url=url,
992
+ json=data,
993
+ headers=headers
994
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.64
3
+ Version: 0.0.66
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.64",
16
+ version="0.0.66",
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