lazyad 0.0.37__tar.gz → 0.0.38__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.
- {lazyad-0.0.37 → lazyad-0.0.38}/PKG-INFO +1 -1
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/crawlers/qq.py +79 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/open/qq.py +102 -1
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.37 → lazyad-0.0.38}/setup.py +1 -1
- {lazyad-0.0.37 → lazyad-0.0.38}/README.md +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/__init__.py +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/crawlers/chuangliang.py +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.37 → lazyad-0.0.38}/setup.cfg +0 -0
|
@@ -98,3 +98,82 @@ def new_account_list(
|
|
|
98
98
|
headers=temp_headers,
|
|
99
99
|
json=data
|
|
100
100
|
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def account_list_v30(
|
|
104
|
+
cookie: str,
|
|
105
|
+
user_id: int,
|
|
106
|
+
business_id: int,
|
|
107
|
+
start_date: str = None,
|
|
108
|
+
end_date: str = None,
|
|
109
|
+
page: int = 1,
|
|
110
|
+
page_size: int = 20,
|
|
111
|
+
account_id: int = None, # 支持按户id搜索
|
|
112
|
+
account_status: int = 1,
|
|
113
|
+
sort_seq: str = None,
|
|
114
|
+
sort_field: str = None,
|
|
115
|
+
platform_type: int = 1
|
|
116
|
+
):
|
|
117
|
+
"""
|
|
118
|
+
概览-账户 ADQ3.0账户列表
|
|
119
|
+
:param cookie:
|
|
120
|
+
:param user_id: 登录用户的id
|
|
121
|
+
:param business_id: 大户id
|
|
122
|
+
:param start_date:
|
|
123
|
+
:param end_date:
|
|
124
|
+
:param page:
|
|
125
|
+
:param page_size:
|
|
126
|
+
:param account_id: 子户id
|
|
127
|
+
:param account_status: 账户状态
|
|
128
|
+
1:有效
|
|
129
|
+
2:待审核
|
|
130
|
+
3:审核不通过
|
|
131
|
+
4:封停
|
|
132
|
+
21:临时冻结
|
|
133
|
+
:return:
|
|
134
|
+
"""
|
|
135
|
+
if not start_date:
|
|
136
|
+
start_date = lazytime.get_date_string(days=-1)
|
|
137
|
+
if not end_date:
|
|
138
|
+
end_date = lazytime.get_date_string(days=-1)
|
|
139
|
+
url = "https://ad.qq.com/tap/v1/account_daily_report/new_account_list?unicode=1&post_format=json"
|
|
140
|
+
temp_headers = copy.deepcopy(default_headers)
|
|
141
|
+
temp_headers["Cookie"] = cookie
|
|
142
|
+
data = {
|
|
143
|
+
"new_source": 1,
|
|
144
|
+
"user_id": user_id,
|
|
145
|
+
"page": page,
|
|
146
|
+
"page_size": page_size,
|
|
147
|
+
"need_sync": True,
|
|
148
|
+
"sync_param_ready": True,
|
|
149
|
+
"business_id_list": [
|
|
150
|
+
business_id
|
|
151
|
+
],
|
|
152
|
+
"dynamic_field_list": [
|
|
153
|
+
"corporation_name",
|
|
154
|
+
"corporation_alias",
|
|
155
|
+
"rule_target_enable",
|
|
156
|
+
"derive_status",
|
|
157
|
+
"comment", # 标签
|
|
158
|
+
"cost" # 消耗
|
|
159
|
+
],
|
|
160
|
+
"time_line": "REQUEST_TIME",
|
|
161
|
+
"start_date_millons": lazytime.get_date2timestamp(date=start_date) * 1000, # 开始时间的时间戳
|
|
162
|
+
"end_date_millons": lazytime.get_date2timestamp(date=end_date) * 1000, # 结束时间的时间戳
|
|
163
|
+
"account_status": account_status,
|
|
164
|
+
"platform_type": platform_type,
|
|
165
|
+
"use_top_sort": True,
|
|
166
|
+
"filter_empty_data": 0
|
|
167
|
+
}
|
|
168
|
+
if account_id:
|
|
169
|
+
data["account_id"] = [account_id]
|
|
170
|
+
if sort_seq:
|
|
171
|
+
data["sort_seq"] = sort_seq # desc:降序排序,会自动过滤0数据
|
|
172
|
+
if sort_field:
|
|
173
|
+
data["sort_field"] = sort_field # cost:按照消耗排序
|
|
174
|
+
return lazyrequests.lazy_requests(
|
|
175
|
+
method="POST",
|
|
176
|
+
url=url,
|
|
177
|
+
headers=temp_headers,
|
|
178
|
+
json=data
|
|
179
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import showlog
|
|
2
1
|
from lazysdk import lazyrequests
|
|
2
|
+
import showlog
|
|
3
3
|
import random
|
|
4
4
|
import time
|
|
5
5
|
import json
|
|
@@ -157,3 +157,104 @@ def get_organization_account_relation(
|
|
|
157
157
|
url=url,
|
|
158
158
|
params=params
|
|
159
159
|
)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def get_advertiser_daily_budget(
|
|
163
|
+
access_token: str,
|
|
164
|
+
account_id
|
|
165
|
+
):
|
|
166
|
+
"""
|
|
167
|
+
版本:3.0
|
|
168
|
+
获取广告账户日预算
|
|
169
|
+
https://developers.e.qq.com/v3.0/docs/api/advertiser_daily_budget/get
|
|
170
|
+
:param access_token:
|
|
171
|
+
:param account_id:
|
|
172
|
+
:return:
|
|
173
|
+
|
|
174
|
+
应答示例
|
|
175
|
+
{
|
|
176
|
+
"code": 0,
|
|
177
|
+
"message": "",
|
|
178
|
+
"message_cn": "",
|
|
179
|
+
"data": {
|
|
180
|
+
"account_id": "<ACCOUNT_ID>",
|
|
181
|
+
"daily_budget": 20000,
|
|
182
|
+
"min_daily_budget": 10000
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
"""
|
|
186
|
+
url = 'https://api.e.qq.com/v3.0/advertiser_daily_budget/get'
|
|
187
|
+
params = {
|
|
188
|
+
'access_token': access_token,
|
|
189
|
+
'timestamp': int(time.time()),
|
|
190
|
+
'nonce': make_nonce(),
|
|
191
|
+
|
|
192
|
+
"account_id": account_id,
|
|
193
|
+
"fields": [
|
|
194
|
+
"account_id",
|
|
195
|
+
"daily_budget"
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
return lazyrequests.lazy_requests(
|
|
199
|
+
method="GET",
|
|
200
|
+
url=url,
|
|
201
|
+
params=params
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def update_daily_budget(
|
|
206
|
+
access_token: str,
|
|
207
|
+
account_id=None,
|
|
208
|
+
daily_budget: int = None,
|
|
209
|
+
update_daily_budget_spec: list = None
|
|
210
|
+
):
|
|
211
|
+
"""
|
|
212
|
+
版本:3.0
|
|
213
|
+
批量修改广告主日限额
|
|
214
|
+
https://developers.e.qq.com/v3.0/docs/api/advertiser/update_daily_budget
|
|
215
|
+
:param access_token:
|
|
216
|
+
:param account_id:
|
|
217
|
+
:param daily_budget: 账户预算,单位为分
|
|
218
|
+
:param update_daily_budget_spec: 任务列表,[{"account_id":"aaa","daily_budget": 100},{"account_id":"bbb","daily_budget": 100}]
|
|
219
|
+
:return:
|
|
220
|
+
|
|
221
|
+
应答示例
|
|
222
|
+
{
|
|
223
|
+
"code": 0,
|
|
224
|
+
"message": "",
|
|
225
|
+
"message_cn": "",
|
|
226
|
+
"data": {
|
|
227
|
+
"list": [
|
|
228
|
+
{
|
|
229
|
+
"code": 0,
|
|
230
|
+
"message": "",
|
|
231
|
+
"message_cn": "",
|
|
232
|
+
"account_id": "<ACCOUNT_ID>"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"fail_id_list": []
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
"""
|
|
239
|
+
url = 'https://api.e.qq.com/v3.0/advertiser/update_daily_budget'
|
|
240
|
+
params = {
|
|
241
|
+
'access_token': access_token,
|
|
242
|
+
'timestamp': int(time.time()),
|
|
243
|
+
'nonce': make_nonce()
|
|
244
|
+
}
|
|
245
|
+
data = dict()
|
|
246
|
+
if update_daily_budget_spec:
|
|
247
|
+
data["update_daily_budget_spec"] = update_daily_budget_spec
|
|
248
|
+
else:
|
|
249
|
+
data["update_daily_budget_spec"] = [
|
|
250
|
+
{
|
|
251
|
+
"account_id": account_id,
|
|
252
|
+
"daily_budget": daily_budget
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
return lazyrequests.lazy_requests(
|
|
256
|
+
method="POST",
|
|
257
|
+
url=url,
|
|
258
|
+
params=params,
|
|
259
|
+
json=data
|
|
260
|
+
)
|
|
@@ -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.
|
|
16
|
+
version="0.0.38",
|
|
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
|
|
File without changes
|
|
File without changes
|