lazyad 0.0.72__tar.gz → 0.0.73__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.72
3
+ Version: 0.0.73
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -362,6 +362,7 @@ def update_ad_batch(
362
362
  ):
363
363
  """
364
364
  暂停广告
365
+ : param operate: 操作:暂停:DISABLE,删除:DELETE
365
366
  :return:
366
367
  """
367
368
  headers = copy.deepcopy(default_headers)
@@ -604,7 +605,8 @@ def get_account_report(
604
605
  conditions: dict = None,
605
606
  kpis: list = None,
606
607
  base_infos: list = None,
607
- time_line: str = "REPORTING_TIME"
608
+ time_line: str = "REPORTING_TIME",
609
+ host: str = "cli2.mobgi.com",
608
610
  ):
609
611
  """
610
612
  推广-广告管理-媒体账户
@@ -625,7 +627,7 @@ def get_account_report(
625
627
  start_date = lazytime.get_date_string(days=0)
626
628
  if not end_date:
627
629
  end_date = lazytime.get_date_string(days=0)
628
- url = "https://cli2.mobgi.com/MainPanelReport/AccountReport/getReport"
630
+ url = f"https://{host}/MainPanelReport/AccountReport/getReport"
629
631
  data = {
630
632
  "data_type": data_type,
631
633
  "media_type": media_type,
@@ -1035,7 +1037,7 @@ def MainPanelReport_AdReport_getReport(
1035
1037
  base_infos: list = None,
1036
1038
  search_field: str = None,
1037
1039
  search_keyword: str = None,
1038
- time_line: str = "REPORTING_TIME",
1040
+ time_line: str = None,
1039
1041
 
1040
1042
  scheme: str = "https",
1041
1043
  host: str = default_host,
@@ -1054,7 +1056,6 @@ def MainPanelReport_AdReport_getReport(
1054
1056
  :param sort_direction: 排序方式,desc:降序
1055
1057
  :param data_type:
1056
1058
  :param conditions: 搜索条件
1057
- :param advertiser_id: 账户id
1058
1059
  :param cdt_start_date: 创建开始时间
1059
1060
  :param cdt_end_date: 创建结束时间
1060
1061
  :param kpis:
@@ -1072,32 +1073,52 @@ def MainPanelReport_AdReport_getReport(
1072
1073
  cdt_end_date = lazytime.get_date_string(days=0)
1073
1074
  if not base_infos:
1074
1075
  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
- }
1076
+ "adgroup_name",
1077
+ "adgroup_id",
1078
+ "advertiser_id",
1079
+ "company",
1080
+ "optimization_goal",
1081
+ "system_status",
1082
+ "bid_amount",
1083
+ "deep_conversion_worth_roi",
1084
+ "created_time",
1085
+ "user_name",
1086
+ "daily_budget",
1087
+ "bid_mode",
1088
+ "deep_conversion_spec",
1089
+ "begin_date"
1090
+ ]
1091
+
1092
+ data = dict()
1093
+
1094
+ # 默认参数
1095
+ if base_infos:
1096
+ data["base_infos"] = base_infos
1097
+ if conditions:
1098
+ data["conditions"] = conditions
1099
+ if data_type:
1100
+ data["data_type"] = data_type
1101
+ if end_date:
1102
+ data["end_date"] = end_date
1103
+ if kpis:
1104
+ data["kpis"] = kpis
1105
+ if media_type:
1106
+ data["media_type"] = media_type
1107
+ if page:
1108
+ data["page"] = page
1109
+ if page_size:
1110
+ data["page_size"] = page_size
1111
+ if sort_direction:
1112
+ data["sort_direction"] = sort_direction
1113
+ if sort_field:
1114
+ data["sort_field"] = sort_field
1115
+ if start_date:
1116
+ data["start_date"] = start_date
1117
+ if time_line:
1118
+ data["time_line"] = time_line
1119
+ if req_source:
1120
+ data["req_source"] = req_source
1121
+
1101
1122
  if media_type == "baidu":
1102
1123
  if not conditions:
1103
1124
  conditions = {
@@ -1114,7 +1135,10 @@ def MainPanelReport_AdReport_getReport(
1114
1135
  if media_account_id:
1115
1136
  conditions["media_account_id"] = [media_account_id]
1116
1137
  data["conditions"] = json.dumps(conditions)
1138
+
1117
1139
  elif media_type in ["gdt_new", "gdt_upgrade"]:
1140
+ if not time_line:
1141
+ time_line = "REPORTING_TIME"
1118
1142
  if not conditions:
1119
1143
  conditions = {
1120
1144
  "is_deleted": "",
@@ -1132,12 +1156,53 @@ def MainPanelReport_AdReport_getReport(
1132
1156
  "time_line": time_line,
1133
1157
  }
1134
1158
  data["conditions"] = json.dumps(conditions)
1135
- if kpis:
1136
- data["kpis"] = kpis
1137
- if req_source:
1138
- data["req_source"] = req_source
1159
+ if time_line:
1160
+ data["time_line"] = time_line
1139
1161
  else:
1140
- return
1162
+ pass
1163
+ headers = copy.deepcopy(default_headers)
1164
+ headers["Cookie"] = cookie
1165
+ return lazyrequests.lazy_requests(
1166
+ method="POST",
1167
+ url=url,
1168
+ json=data,
1169
+ headers=headers
1170
+ )
1171
+
1172
+
1173
+ def Advertiser_getRealAdvertiserData(
1174
+ cookie: str,
1175
+ start_date: str = None,
1176
+ end_date: str = None,
1177
+ media_account_ids: list = None,
1178
+ conditions: str = None,
1179
+ scheme: str = "https",
1180
+ host: str = default_host,
1181
+ filename: str = "/Toutiao/Advertiser/getRealAdvertiserData"
1182
+ ):
1183
+ """
1184
+ 推广-广告管理-广告 获取最新的广告数据
1185
+ :param cookie:
1186
+ :param start_date: 数据开始日期
1187
+ :param end_date: 数据结束日期
1188
+ :return:
1189
+ """
1190
+ url = f"{scheme}://{host}{filename}"
1191
+ if not start_date:
1192
+ start_date = lazytime.get_date_string(days=0)
1193
+ if not end_date:
1194
+ end_date = lazytime.get_date_string(days=0)
1195
+
1196
+ if not conditions and media_account_ids:
1197
+ conditions_list = list()
1198
+ for each_media_account_id in media_account_ids:
1199
+ conditions_list.append({"media_account_id": str(each_media_account_id)})
1200
+ conditions = json.dumps(conditions_list)
1201
+ data = {
1202
+ "conditions": conditions,
1203
+ "start_date": start_date,
1204
+ "end_date": end_date
1205
+ }
1141
1206
  headers = copy.deepcopy(default_headers)
1142
1207
  headers["Cookie"] = cookie
1143
1208
  return lazyrequests.lazy_requests(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.72
3
+ Version: 0.0.73
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.72",
16
+ version="0.0.73",
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
File without changes