lazyad 0.0.10__tar.gz → 0.0.11__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.10 → lazyad-0.0.11}/PKG-INFO +1 -1
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/open/qq.py +9 -11
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.10 → lazyad-0.0.11}/setup.py +1 -1
- {lazyad-0.0.10 → lazyad-0.0.11}/README.md +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/__init__.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/crawlers/chuangliang.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.10 → lazyad-0.0.11}/setup.cfg +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
from lazysdk import lazyrequests
|
|
2
2
|
import random
|
|
3
|
+
import time
|
|
3
4
|
import json
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
|
|
6
7
|
"""
|
|
7
8
|
2024-04-11 全面升级至3.0版本 https://developers.e.qq.com/v3.0/docs/api
|
|
@@ -63,10 +64,10 @@ def oauth_token2(
|
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
def oauth_token3(
|
|
66
|
-
access_token,
|
|
67
67
|
app_id,
|
|
68
68
|
app_secret,
|
|
69
69
|
redirect_uri=None,
|
|
70
|
+
access_token=None,
|
|
70
71
|
grant_type='authorization_code',
|
|
71
72
|
auth_code=None,
|
|
72
73
|
refresh_token=None,
|
|
@@ -85,14 +86,15 @@ def oauth_token3(
|
|
|
85
86
|
"""
|
|
86
87
|
url = 'https://api.e.qq.com/v3.0/oauth/token'
|
|
87
88
|
params = {
|
|
88
|
-
'access_token': access_token,
|
|
89
|
-
'timestamp': int(time.time()),
|
|
90
|
-
'nonce': make_nonce,
|
|
91
|
-
|
|
92
89
|
'client_id': app_id,
|
|
93
90
|
'client_secret': app_secret,
|
|
94
91
|
'grant_type': grant_type
|
|
95
92
|
}
|
|
93
|
+
if access_token:
|
|
94
|
+
# OAuth 相关接口无需提供 access_token、timestamp、nonce 等通用请求参数。
|
|
95
|
+
params['access_token'] = access_token
|
|
96
|
+
params['timestamp'] = int(time.time())
|
|
97
|
+
params['nonce'] = make_nonce()
|
|
96
98
|
if auth_code:
|
|
97
99
|
params['authorization_code'] = auth_code
|
|
98
100
|
if refresh_token:
|
|
@@ -101,10 +103,6 @@ def oauth_token3(
|
|
|
101
103
|
redirect_uri = f'{redirect_uri}?app_id={app_id}'
|
|
102
104
|
params['redirect_uri'] = redirect_uri
|
|
103
105
|
|
|
104
|
-
# for k in params:
|
|
105
|
-
# if type(params[k]) is not str:
|
|
106
|
-
# params[k] = json.dumps(params[k])
|
|
107
|
-
|
|
108
106
|
return lazyrequests.lazy_requests(
|
|
109
107
|
method="GET",
|
|
110
108
|
url=url,
|
|
@@ -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.11",
|
|
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
|
|
File without changes
|