lazyad 0.0.38__tar.gz → 0.0.40__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.38 → lazyad-0.0.40}/PKG-INFO +12 -2
- {lazyad-0.0.38 → lazyad-0.0.40}/README.md +11 -1
- lazyad-0.0.40/lazyad/crawlers/mintegral.py +193 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/open/qq.py +1 -1
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad.egg-info/PKG-INFO +12 -2
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad.egg-info/SOURCES.txt +1 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/setup.py +1 -1
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/__init__.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/crawlers/chuangliang.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.38 → lazyad-0.0.40}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lazyad
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.40
|
|
4
4
|
Summary: 基于Python的懒人包-适用于广告投放模块
|
|
5
5
|
Home-page: https://gitee.com/ZeroSeeker/lazyad
|
|
6
6
|
Author: ZeroSeeker
|
|
@@ -23,7 +23,17 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN
|
|
|
23
23
|
|
|
24
24
|
#### 安装教程
|
|
25
25
|
|
|
26
|
-
1.
|
|
26
|
+
1. 使用pip安装
|
|
27
|
+
- 普通方式安装
|
|
28
|
+
```shell script
|
|
29
|
+
pip3 install lazyad
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- 使用阿里镜像加速安装
|
|
33
|
+
```shell script
|
|
34
|
+
pip3 install lazyad -i https://mirrors.aliyun.com/pypi/simple
|
|
35
|
+
```
|
|
36
|
+
|
|
27
37
|
2. xxxx
|
|
28
38
|
3. xxxx
|
|
29
39
|
|
|
@@ -11,7 +11,17 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN
|
|
|
11
11
|
|
|
12
12
|
#### 安装教程
|
|
13
13
|
|
|
14
|
-
1.
|
|
14
|
+
1. 使用pip安装
|
|
15
|
+
- 普通方式安装
|
|
16
|
+
```shell script
|
|
17
|
+
pip3 install lazyad
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- 使用阿里镜像加速安装
|
|
21
|
+
```shell script
|
|
22
|
+
pip3 install lazyad -i https://mirrors.aliyun.com/pypi/simple
|
|
23
|
+
```
|
|
24
|
+
|
|
15
25
|
2. xxxx
|
|
16
26
|
3. xxxx
|
|
17
27
|
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
from lazysdk import lazyrequests
|
|
2
|
+
from lazysdk import lazytime
|
|
3
|
+
import copy
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
官网:https://adv.mintegral.com/cn/login
|
|
8
|
+
"""
|
|
9
|
+
default_headers = {
|
|
10
|
+
"Accept": "application/json, text/plain, */*",
|
|
11
|
+
"Accept-Encoding": "gzip, deflated",
|
|
12
|
+
"Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
|
|
13
|
+
"Cache-Control": "no-cache",
|
|
14
|
+
"Connection": "keep-alive",
|
|
15
|
+
"Cookie": "",
|
|
16
|
+
"Host": "ss-api.mintegral.com",
|
|
17
|
+
"Origin": "https://adv.mintegral.com",
|
|
18
|
+
"Pragma": "no-cache",
|
|
19
|
+
"Referer": "https://adv.mintegral.com/cn/login",
|
|
20
|
+
"Sec-Fetch-Dest": "empty",
|
|
21
|
+
"Sec-Fetch-Mode": "cors",
|
|
22
|
+
"Sec-Fetch-Site": "same-site",
|
|
23
|
+
"Sec-GPC": "1",
|
|
24
|
+
"TE": "trailers",
|
|
25
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def auth(
|
|
30
|
+
cookie: str
|
|
31
|
+
):
|
|
32
|
+
"""
|
|
33
|
+
验证cookie是否有效
|
|
34
|
+
需要登录:{'code': 400, 'msg': 'Please login first', 'data': None}
|
|
35
|
+
验证成功:{'code': 200, 'msg': 'success', 'data': {}
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
url = "https://ss-api.mintegral.com/api/v1/auth"
|
|
39
|
+
headers = copy.deepcopy(default_headers)
|
|
40
|
+
headers["Cookie"] = cookie
|
|
41
|
+
return lazyrequests.lazy_requests(
|
|
42
|
+
method="GET",
|
|
43
|
+
url=url,
|
|
44
|
+
headers=headers
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def options(
|
|
49
|
+
cookie: str
|
|
50
|
+
):
|
|
51
|
+
"""
|
|
52
|
+
获取系统的基本选项
|
|
53
|
+
需要登录:{'code': 400, 'msg': 'Please login first', 'data': None}
|
|
54
|
+
验证成功:
|
|
55
|
+
{
|
|
56
|
+
'code': 200,
|
|
57
|
+
'msg': 'success',
|
|
58
|
+
'data': {
|
|
59
|
+
'offer': ...,
|
|
60
|
+
'campaign': ...,
|
|
61
|
+
...
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
"""
|
|
65
|
+
scheme = "https"
|
|
66
|
+
host = "ss-api.mintegral.com"
|
|
67
|
+
filename = "/api/v1/options/_batch"
|
|
68
|
+
params = {
|
|
69
|
+
"query": "offer,campaign,offer-status,billing-type,country,timezone,country-region-city"
|
|
70
|
+
}
|
|
71
|
+
url = f"{scheme}://{host}{filename}"
|
|
72
|
+
headers = copy.deepcopy(default_headers)
|
|
73
|
+
headers["Cookie"] = cookie
|
|
74
|
+
return lazyrequests.lazy_requests(
|
|
75
|
+
method="GET",
|
|
76
|
+
params=params,
|
|
77
|
+
url=url,
|
|
78
|
+
headers=headers
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def offers(
|
|
83
|
+
cookie: str,
|
|
84
|
+
offer_id: int = None,
|
|
85
|
+
method: str = "GET",
|
|
86
|
+
put_data: dict = None,
|
|
87
|
+
page: int = 1,
|
|
88
|
+
page_size: int = 50
|
|
89
|
+
):
|
|
90
|
+
"""
|
|
91
|
+
获取广告单元列表
|
|
92
|
+
需要登录:{'code': 400, 'msg': 'Please login first', 'data': None}
|
|
93
|
+
验证成功:{'code': 200, 'msg': 'success', 'data': {}
|
|
94
|
+
"""
|
|
95
|
+
scheme = "https"
|
|
96
|
+
host = "ss-api.mintegral.com"
|
|
97
|
+
if not offer_id:
|
|
98
|
+
filename = "/api/v1/offers"
|
|
99
|
+
params = {
|
|
100
|
+
"limit": page_size,
|
|
101
|
+
"page": page,
|
|
102
|
+
"order": "DESC",
|
|
103
|
+
"sort": "id"
|
|
104
|
+
}
|
|
105
|
+
else:
|
|
106
|
+
filename = f"/api/v1/offers/{offer_id}"
|
|
107
|
+
if method == "PUT":
|
|
108
|
+
params = put_data
|
|
109
|
+
else:
|
|
110
|
+
params = {}
|
|
111
|
+
|
|
112
|
+
url = f"{scheme}://{host}{filename}"
|
|
113
|
+
headers = copy.deepcopy(default_headers)
|
|
114
|
+
headers["Cookie"] = cookie
|
|
115
|
+
return lazyrequests.lazy_requests(
|
|
116
|
+
method=method,
|
|
117
|
+
params=params,
|
|
118
|
+
url=url,
|
|
119
|
+
headers=headers
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def performance(
|
|
124
|
+
cookie: str,
|
|
125
|
+
page: int = 1,
|
|
126
|
+
page_size: int = 50,
|
|
127
|
+
timezone: int = 8,
|
|
128
|
+
start_time: str = None,
|
|
129
|
+
end_time: str = None,
|
|
130
|
+
show_calendar_day: int = 2,
|
|
131
|
+
total: bool = False,
|
|
132
|
+
breakdowns: list = None,
|
|
133
|
+
metrics: list = None
|
|
134
|
+
):
|
|
135
|
+
"""
|
|
136
|
+
获取广告单元列表
|
|
137
|
+
需要登录:{'code': 400, 'msg': 'Please login first', 'data': None}
|
|
138
|
+
验证成功:{'code': 200, 'msg': 'success', 'data': {}
|
|
139
|
+
"""
|
|
140
|
+
scheme = "https"
|
|
141
|
+
host = "ss-api.mintegral.com"
|
|
142
|
+
filename = "/api/v1/reports/performance"
|
|
143
|
+
filename_total = "/api/v1/reports/performance-total"
|
|
144
|
+
if not start_time:
|
|
145
|
+
start_time = lazytime.get_date_string(days=0)
|
|
146
|
+
if not end_time:
|
|
147
|
+
end_time = lazytime.get_date_string(days=0)
|
|
148
|
+
if not breakdowns:
|
|
149
|
+
breakdowns = ["date", "adv_offer_id"]
|
|
150
|
+
if not metrics:
|
|
151
|
+
metrics = [
|
|
152
|
+
"adv_impression",
|
|
153
|
+
"adv_click",
|
|
154
|
+
"adv_install",
|
|
155
|
+
"ecpm",
|
|
156
|
+
"ecpc",
|
|
157
|
+
"ecpi",
|
|
158
|
+
"ctr",
|
|
159
|
+
"ivr",
|
|
160
|
+
"cvr",
|
|
161
|
+
"adv_original_money",
|
|
162
|
+
"iaa_d0_ad_revenue",
|
|
163
|
+
"iaa_d0_roas"
|
|
164
|
+
]
|
|
165
|
+
params = {
|
|
166
|
+
"limit": page_size,
|
|
167
|
+
"page": page,
|
|
168
|
+
"timezone": timezone,
|
|
169
|
+
"start_time": start_time,
|
|
170
|
+
"end_time": end_time,
|
|
171
|
+
"order": "DESC",
|
|
172
|
+
"breakdowns": ",".join(breakdowns),
|
|
173
|
+
"metrics": ",".join(metrics),
|
|
174
|
+
"show_calendar_day": show_calendar_day
|
|
175
|
+
}
|
|
176
|
+
url = f"{scheme}://{host}{filename}"
|
|
177
|
+
url_total = f"{scheme}://{host}{filename_total}"
|
|
178
|
+
headers = copy.deepcopy(default_headers)
|
|
179
|
+
headers["Cookie"] = cookie
|
|
180
|
+
if total:
|
|
181
|
+
return lazyrequests.lazy_requests(
|
|
182
|
+
method="GET",
|
|
183
|
+
params=params,
|
|
184
|
+
url=url_total,
|
|
185
|
+
headers=headers
|
|
186
|
+
)
|
|
187
|
+
else:
|
|
188
|
+
return lazyrequests.lazy_requests(
|
|
189
|
+
method="GET",
|
|
190
|
+
params=params,
|
|
191
|
+
url=url,
|
|
192
|
+
headers=headers
|
|
193
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lazyad
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.40
|
|
4
4
|
Summary: 基于Python的懒人包-适用于广告投放模块
|
|
5
5
|
Home-page: https://gitee.com/ZeroSeeker/lazyad
|
|
6
6
|
Author: ZeroSeeker
|
|
@@ -23,7 +23,17 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN
|
|
|
23
23
|
|
|
24
24
|
#### 安装教程
|
|
25
25
|
|
|
26
|
-
1.
|
|
26
|
+
1. 使用pip安装
|
|
27
|
+
- 普通方式安装
|
|
28
|
+
```shell script
|
|
29
|
+
pip3 install lazyad
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- 使用阿里镜像加速安装
|
|
33
|
+
```shell script
|
|
34
|
+
pip3 install lazyad -i https://mirrors.aliyun.com/pypi/simple
|
|
35
|
+
```
|
|
36
|
+
|
|
27
37
|
2. xxxx
|
|
28
38
|
3. xxxx
|
|
29
39
|
|
|
@@ -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.40",
|
|
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
|