lazyad 0.0.5__tar.gz → 0.0.7__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.5 → lazyad-0.0.7}/PKG-INFO +1 -1
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad/__init__.py +1 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad/crawlers/qq.py +9 -2
- lazyad-0.0.7/lazyad/open/__init__.py +0 -0
- lazyad-0.0.7/lazyad/open/qq.py +68 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad.egg-info/SOURCES.txt +3 -1
- {lazyad-0.0.5 → lazyad-0.0.7}/setup.py +1 -1
- {lazyad-0.0.5 → lazyad-0.0.7}/README.md +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad/crawlers/chuangliang.py +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.5 → lazyad-0.0.7}/setup.cfg +0 -0
|
@@ -29,7 +29,8 @@ def new_account_list(
|
|
|
29
29
|
end_date: str = None,
|
|
30
30
|
page: int = 1,
|
|
31
31
|
page_size: int = 20,
|
|
32
|
-
account_id: int = None # 支持按户id搜索
|
|
32
|
+
account_id: int = None, # 支持按户id搜索
|
|
33
|
+
account_status: int = 1
|
|
33
34
|
):
|
|
34
35
|
"""
|
|
35
36
|
概览-账户 页面按照消耗降序排序的数据
|
|
@@ -41,6 +42,12 @@ def new_account_list(
|
|
|
41
42
|
:param page:
|
|
42
43
|
:param page_size:
|
|
43
44
|
:param account_id: 子户id
|
|
45
|
+
:param account_status: 账户状态
|
|
46
|
+
1:有效
|
|
47
|
+
2:待审核
|
|
48
|
+
3:审核不通过
|
|
49
|
+
4:封停
|
|
50
|
+
21:临时冻结
|
|
44
51
|
:return:
|
|
45
52
|
"""
|
|
46
53
|
if not start_date:
|
|
@@ -73,7 +80,7 @@ def new_account_list(
|
|
|
73
80
|
"time_line": "REQUEST_TIME",
|
|
74
81
|
"start_date_millons": lazytime.get_date2timestamp(date=start_date) * 1000, # 开始时间的时间戳
|
|
75
82
|
"end_date_millons": lazytime.get_date2timestamp(date=end_date) * 1000, # 结束时间的时间戳
|
|
76
|
-
"account_status":
|
|
83
|
+
"account_status": account_status,
|
|
77
84
|
"platform_type": 1,
|
|
78
85
|
"use_top_sort": True,
|
|
79
86
|
"filter_empty_data": 0
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import random
|
|
3
|
+
import json
|
|
4
|
+
from lazysdk import lazyrequests
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
2024-04-11 全面升级至3.0版本 https://developers.e.qq.com/v3.0/docs/api
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def make_nonce():
|
|
12
|
+
"""
|
|
13
|
+
参考示例代码的生成一个随机数
|
|
14
|
+
:return:
|
|
15
|
+
"""
|
|
16
|
+
return str(time.time()) + str(random.randint(0, 999999))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def oauth_token(
|
|
20
|
+
access_token,
|
|
21
|
+
app_id,
|
|
22
|
+
app_secret,
|
|
23
|
+
grant_type='authorization_code',
|
|
24
|
+
auth_code=None,
|
|
25
|
+
refresh_token=None,
|
|
26
|
+
redirect_uri=None
|
|
27
|
+
):
|
|
28
|
+
"""
|
|
29
|
+
获取/刷新token
|
|
30
|
+
相关文档:https://developers.e.qq.com/v3.0/docs/api/oauth/token
|
|
31
|
+
:param access_token:
|
|
32
|
+
:param auth_code:
|
|
33
|
+
:param app_id:
|
|
34
|
+
:param app_secret:
|
|
35
|
+
:param grant_type: 请求的类型,可选值:authorization_code(授权码方式获取 token)、refresh_token(刷新 token)
|
|
36
|
+
:param refresh_token:
|
|
37
|
+
:param redirect_uri:
|
|
38
|
+
:return:
|
|
39
|
+
"""
|
|
40
|
+
if grant_type and not redirect_uri:
|
|
41
|
+
redirect_uri = f'https://open.fanshang888.com/api/cache/receive/open_api/ad/ad_developer/qq/callback?app_id={app_id}'
|
|
42
|
+
|
|
43
|
+
url = 'https://api.e.qq.com/v3.0/oauth/token'
|
|
44
|
+
params = {
|
|
45
|
+
'access_token': access_token,
|
|
46
|
+
'timestamp': int(time.time()),
|
|
47
|
+
'nonce': make_nonce,
|
|
48
|
+
|
|
49
|
+
'client_id': app_id,
|
|
50
|
+
'client_secret': app_secret,
|
|
51
|
+
'grant_type': grant_type
|
|
52
|
+
}
|
|
53
|
+
if auth_code:
|
|
54
|
+
params['authorization_code'] = auth_code
|
|
55
|
+
if refresh_token:
|
|
56
|
+
params['refresh_token'] = refresh_token
|
|
57
|
+
if redirect_uri:
|
|
58
|
+
params['redirect_uri'] = redirect_uri
|
|
59
|
+
|
|
60
|
+
for k in params:
|
|
61
|
+
if type(params[k]) is not str:
|
|
62
|
+
params[k] = json.dumps(params[k])
|
|
63
|
+
|
|
64
|
+
return lazyrequests.lazy_requests(
|
|
65
|
+
method="GET",
|
|
66
|
+
url=url,
|
|
67
|
+
params=params
|
|
68
|
+
)
|
|
@@ -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.7",
|
|
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
|