pyscriptbase 1.0.4__tar.gz → 1.1.0__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.
- pyscriptbase-1.1.0/PKG-INFO +12 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/pusher.py +28 -7
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/script.py +44 -8
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/util.py +13 -2
- pyscriptbase-1.1.0/pyscriptbase.egg-info/PKG-INFO +12 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/setup.py +1 -1
- pyscriptbase-1.0.4/PKG-INFO +0 -24
- pyscriptbase-1.0.4/pyscriptbase.egg-info/PKG-INFO +0 -24
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/README.md +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/__init__.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/app.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/cipher.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/database.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/env.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/net.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/panel.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase/webview.py +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase.egg-info/SOURCES.txt +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase.egg-info/dependency_links.txt +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase.egg-info/requires.txt +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/pyscriptbase.egg-info/top_level.txt +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/setup.cfg +0 -0
- {pyscriptbase-1.0.4 → pyscriptbase-1.1.0}/test/test.py +0 -0
|
@@ -15,10 +15,16 @@ class HtmlTableEmail:
|
|
|
15
15
|
def __init__(self, title: str, headers: list[str] = [], appendIndex: bool = True):
|
|
16
16
|
self.title = title
|
|
17
17
|
self.headers: list[str] = headers
|
|
18
|
-
self.rows: list[str | int] = []
|
|
18
|
+
self.rows: list[list[str | int | tuple]] = []
|
|
19
19
|
self.extras: list[str] = []
|
|
20
20
|
self.appendIndex = appendIndex
|
|
21
21
|
|
|
22
|
+
def addRow(self, row: list[str | int | tuple]) -> None:
|
|
23
|
+
self.rows.append(row)
|
|
24
|
+
|
|
25
|
+
def addExtra(self, extra: str) -> None:
|
|
26
|
+
self.extras.append(extra)
|
|
27
|
+
|
|
22
28
|
def toStr(self) -> str:
|
|
23
29
|
result = ""
|
|
24
30
|
for index, row in enumerate(self.rows):
|
|
@@ -132,12 +138,18 @@ class SMTPParams:
|
|
|
132
138
|
self.password = password
|
|
133
139
|
|
|
134
140
|
|
|
135
|
-
def sendQQMail(
|
|
141
|
+
def sendQQMail(
|
|
142
|
+
title: str, content: str, receiver: str = None, params: SMTPParams = None
|
|
143
|
+
):
|
|
136
144
|
# 设置SMTP服务器地址和端口
|
|
137
145
|
smtp_server = params.server if params else Env.get("smtp_server")
|
|
138
|
-
port =
|
|
146
|
+
port = (
|
|
147
|
+
params.port if params else Env.getInt("smtp_port")
|
|
148
|
+
) # 对于TLS,通常使用587端口;对于SSL,使用465端口
|
|
139
149
|
sender = params.sender if params else Env.get("smtp_sender") # 你的电子邮件地址
|
|
140
|
-
password =
|
|
150
|
+
password = (
|
|
151
|
+
params.password if params else Env.get("smtp_password")
|
|
152
|
+
) # 你的电子邮件密码(对于某些电子邮件提供商,你可能需要生成一个应用专用密码)
|
|
141
153
|
receiver = receiver if receiver else Env.get("smtp_receiver")
|
|
142
154
|
|
|
143
155
|
if not sender or not password:
|
|
@@ -161,12 +173,21 @@ def sendQQMail(title: str, content: str, receiver: str = None, params: SMTPParam
|
|
|
161
173
|
print(f"Error: unable to send email. {e}")
|
|
162
174
|
|
|
163
175
|
|
|
164
|
-
def sendMail(
|
|
176
|
+
def sendMail(
|
|
177
|
+
title: str,
|
|
178
|
+
content: str | HtmlTableEmail,
|
|
179
|
+
receiver: str = None,
|
|
180
|
+
params: SMTPParams = None,
|
|
181
|
+
):
|
|
165
182
|
# 设置SMTP服务器地址和端口
|
|
166
183
|
smtp_server = params.server if params else Env.get("smtp_server")
|
|
167
|
-
port =
|
|
184
|
+
port = (
|
|
185
|
+
params.port if params else Env.getInt("smtp_port")
|
|
186
|
+
) # 对于TLS,通常使用587端口;对于SSL,使用465端口
|
|
168
187
|
sender = params.sender if params else Env.get("smtp_sender") # 你的电子邮件地址
|
|
169
|
-
password =
|
|
188
|
+
password = (
|
|
189
|
+
params.password if params else Env.get("smtp_password")
|
|
190
|
+
) # 你的电子邮件密码(对于某些电子邮件提供商,你可能需要生成一个应用专用密码)
|
|
170
191
|
receiver = receiver if receiver else Env.get("smtp_receiver")
|
|
171
192
|
|
|
172
193
|
if not sender or not password:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
2
|
+
from traceback import format_exc
|
|
2
3
|
from . import net
|
|
3
4
|
from . import database
|
|
4
5
|
|
|
@@ -7,7 +8,13 @@ class ScriptApp:
|
|
|
7
8
|
_proxies = []
|
|
8
9
|
_cloudProxies = []
|
|
9
10
|
|
|
10
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
index: int = 1,
|
|
14
|
+
useProxy: bool = True,
|
|
15
|
+
debug: bool = False,
|
|
16
|
+
useCloud: bool = True,
|
|
17
|
+
) -> None:
|
|
11
18
|
self.index = index
|
|
12
19
|
self.logs = []
|
|
13
20
|
self.debug = debug
|
|
@@ -23,13 +30,29 @@ class ScriptApp:
|
|
|
23
30
|
return
|
|
24
31
|
if len(ScriptApp._proxies) == 0:
|
|
25
32
|
try:
|
|
26
|
-
sql = database.SQLHelper(
|
|
33
|
+
sql = database.SQLHelper(
|
|
34
|
+
user=config.user,
|
|
35
|
+
password=config.password,
|
|
36
|
+
port=config.port,
|
|
37
|
+
database=config.database,
|
|
38
|
+
host=config.host,
|
|
39
|
+
)
|
|
27
40
|
fields = ["host", "port"]
|
|
28
41
|
wheres = [["type", 1], ["state", 1]]
|
|
29
|
-
datas =
|
|
42
|
+
datas = (
|
|
43
|
+
sql.set_table(config.table)
|
|
44
|
+
.set_wheres(wheres)
|
|
45
|
+
.set_fields(fields)
|
|
46
|
+
.query_dict()
|
|
47
|
+
)
|
|
30
48
|
proxies = [None]
|
|
31
49
|
for data in datas:
|
|
32
|
-
proxies.append(
|
|
50
|
+
proxies.append(
|
|
51
|
+
{
|
|
52
|
+
"http": f"http://{data['host']}:{data['port']}",
|
|
53
|
+
"https": f"http://{data['host']}:{data['port']}",
|
|
54
|
+
}
|
|
55
|
+
)
|
|
33
56
|
ScriptApp._proxies = proxies
|
|
34
57
|
except:
|
|
35
58
|
ScriptApp._proxies = [None]
|
|
@@ -42,15 +65,28 @@ class ScriptApp:
|
|
|
42
65
|
return
|
|
43
66
|
if len(ScriptApp._cloudProxies) == 0:
|
|
44
67
|
try:
|
|
45
|
-
sql = database.SQLHelper(
|
|
68
|
+
sql = database.SQLHelper(
|
|
69
|
+
user=config.user,
|
|
70
|
+
password=config.password,
|
|
71
|
+
port=config.port,
|
|
72
|
+
database=config.database,
|
|
73
|
+
host=config.host,
|
|
74
|
+
)
|
|
46
75
|
fields = ["url", "token"]
|
|
47
76
|
wheres = [["state", 1]]
|
|
48
|
-
datas =
|
|
77
|
+
datas = (
|
|
78
|
+
sql.set_table(config.table)
|
|
79
|
+
.set_wheres(wheres)
|
|
80
|
+
.set_fields(fields)
|
|
81
|
+
.query_dict()
|
|
82
|
+
)
|
|
49
83
|
ScriptApp._cloudProxies = datas
|
|
50
84
|
except:
|
|
51
85
|
ScriptApp._cloudProxies = []
|
|
52
86
|
if len(ScriptApp._cloudProxies):
|
|
53
|
-
self.cloudNet.cloud = ScriptApp._cloudProxies[
|
|
87
|
+
self.cloudNet.cloud = ScriptApp._cloudProxies[
|
|
88
|
+
index % len(ScriptApp._cloudProxies)
|
|
89
|
+
]
|
|
54
90
|
|
|
55
91
|
def __log__(self, msg: str | dict = "", flush: bool = False):
|
|
56
92
|
if flush or self.debug:
|
|
@@ -65,7 +101,7 @@ class ScriptApp:
|
|
|
65
101
|
try:
|
|
66
102
|
return fun(*args, **kwargs)
|
|
67
103
|
except Exception as e:
|
|
68
|
-
self.__log__(
|
|
104
|
+
self.__log__(format_exc())
|
|
69
105
|
|
|
70
106
|
|
|
71
107
|
class InviteObj:
|
|
@@ -6,7 +6,15 @@ import string
|
|
|
6
6
|
|
|
7
7
|
def generateRandomPhoneUA():
|
|
8
8
|
# 手机设备品牌与型号
|
|
9
|
-
devices = [
|
|
9
|
+
devices = [
|
|
10
|
+
"Samsung Galaxy S21",
|
|
11
|
+
"Xiaomi Mi 11",
|
|
12
|
+
"Google Pixel 6",
|
|
13
|
+
"Huawei P40",
|
|
14
|
+
"OPPO Reno5",
|
|
15
|
+
"Vivo X60",
|
|
16
|
+
"OnePlus 9",
|
|
17
|
+
]
|
|
10
18
|
|
|
11
19
|
# 操作系统版本
|
|
12
20
|
os_versions = ["Android 11", "Android 12", "Android 13"]
|
|
@@ -78,9 +86,12 @@ def daysDifference(date_str: str) -> int:
|
|
|
78
86
|
return days_diff
|
|
79
87
|
|
|
80
88
|
|
|
81
|
-
def threadPool(func, args, num=5):
|
|
89
|
+
def threadPool(func, args, num=5) -> list:
|
|
82
90
|
# 启用线程池
|
|
83
91
|
executor = ThreadPoolExecutor(max_workers=num)
|
|
84
92
|
tasks = [executor.submit(func, arg, index + 1) for index, arg in enumerate(args)]
|
|
93
|
+
results = []
|
|
85
94
|
for future in as_completed(tasks):
|
|
86
95
|
data = future.result()
|
|
96
|
+
results.append(data)
|
|
97
|
+
return results
|
pyscriptbase-1.0.4/PKG-INFO
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: pyscriptbase
|
|
3
|
-
Version: 1.0.4
|
|
4
|
-
Summary: python script base library
|
|
5
|
-
Home-page:
|
|
6
|
-
Author: ASMan
|
|
7
|
-
Author-email:
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: loguru
|
|
10
|
-
Requires-Dist: selenium
|
|
11
|
-
Requires-Dist: pymysql
|
|
12
|
-
Requires-Dist: pycryptodome
|
|
13
|
-
Requires-Dist: pyyaml
|
|
14
|
-
Requires-Dist: xmltodict
|
|
15
|
-
Requires-Dist: prettytable
|
|
16
|
-
Requires-Dist: pyjwt
|
|
17
|
-
Requires-Dist: fake_useragent
|
|
18
|
-
Requires-Dist: beautifulsoup4
|
|
19
|
-
Requires-Dist: requests
|
|
20
|
-
Requires-Dist: lxml
|
|
21
|
-
|
|
22
|
-
# Instructions
|
|
23
|
-
|
|
24
|
-
python script base library
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: pyscriptbase
|
|
3
|
-
Version: 1.0.4
|
|
4
|
-
Summary: python script base library
|
|
5
|
-
Home-page:
|
|
6
|
-
Author: ASMan
|
|
7
|
-
Author-email:
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: loguru
|
|
10
|
-
Requires-Dist: selenium
|
|
11
|
-
Requires-Dist: pymysql
|
|
12
|
-
Requires-Dist: pycryptodome
|
|
13
|
-
Requires-Dist: pyyaml
|
|
14
|
-
Requires-Dist: xmltodict
|
|
15
|
-
Requires-Dist: prettytable
|
|
16
|
-
Requires-Dist: pyjwt
|
|
17
|
-
Requires-Dist: fake_useragent
|
|
18
|
-
Requires-Dist: beautifulsoup4
|
|
19
|
-
Requires-Dist: requests
|
|
20
|
-
Requires-Dist: lxml
|
|
21
|
-
|
|
22
|
-
# Instructions
|
|
23
|
-
|
|
24
|
-
python script base library
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|