pyscriptbase 1.1.4__tar.gz → 1.1.5__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.
Files changed (22) hide show
  1. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/PKG-INFO +1 -1
  2. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/pusher.py +8 -0
  3. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/sms.py +25 -6
  4. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase.egg-info/PKG-INFO +1 -1
  5. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/setup.py +2 -2
  6. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/README.md +0 -0
  7. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/__init__.py +0 -0
  8. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/app.py +0 -0
  9. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/cipher.py +0 -0
  10. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/database.py +0 -0
  11. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/env.py +0 -0
  12. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/net.py +0 -0
  13. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/panel.py +0 -0
  14. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/script.py +0 -0
  15. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/util.py +0 -0
  16. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase/webview.py +0 -0
  17. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase.egg-info/SOURCES.txt +0 -0
  18. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase.egg-info/dependency_links.txt +0 -0
  19. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase.egg-info/requires.txt +0 -0
  20. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/pyscriptbase.egg-info/top_level.txt +0 -0
  21. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/setup.cfg +0 -0
  22. {pyscriptbase-1.1.4 → pyscriptbase-1.1.5}/test/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyscriptbase
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: python script base library
5
5
  Home-page:
6
6
  Author: ASMan
@@ -213,3 +213,11 @@ def sendMail(
213
213
  server.sendmail(sender, receiver, message.as_string()) # 发送邮件
214
214
  except Exception as e:
215
215
  print(f"Error: unable to send email. {e}")
216
+
217
+
218
+ def sendMailWithHtmlTable(
219
+ table: HtmlTableEmail,
220
+ receiver: str = None,
221
+ params: SMTPParams = None,
222
+ ):
223
+ sendMail(table.title, table, receiver, params)
@@ -82,7 +82,11 @@ class FeiyunApp:
82
82
  self.__log__("登录失败")
83
83
  self.isLogin = False
84
84
 
85
- def getPhone(self):
85
+ def getPhone(self) -> str | None:
86
+ """
87
+ 获取手机号
88
+ :return: 手机号 | invalid(不可用) | None(获取失败)
89
+ """
86
90
  headers = {
87
91
  "Sec-Ch-UA": '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
88
92
  "Sec-Ch-UA-Mobile": "?0",
@@ -106,6 +110,9 @@ class FeiyunApp:
106
110
  # print(f"获取手机号失败: 预检 {text}")
107
111
  # return None
108
112
 
113
+ if not self.isLogin:
114
+ return "invalid"
115
+
109
116
  url = f"{self.host}/index.php?m=home&c=Index&a=getxksjh"
110
117
  text = requests.get(
111
118
  url=url, headers=headers, proxies=self.proxies, verify=False
@@ -115,11 +122,23 @@ class FeiyunApp:
115
122
  if text and text.isdigit():
116
123
  print(f"获取手机号成功:{text}")
117
124
  return text
125
+ elif text == "buzu":
126
+ print(f"账号余额不足: {text}")
127
+ return "invalid"
118
128
  else:
119
129
  print(f"获取手机号失败: {text}")
120
130
  return None
121
131
 
122
- def getCode(self, phone: str, project: str):
132
+ def getCode(self, phone: str, project: str) -> str | None:
133
+ """
134
+ 获取验证码
135
+ :param phone: 手机号
136
+ :param project: 项目
137
+ :return: 验证码 | invalid(不可用) | None(获取失败)
138
+ """
139
+ if not self.isLogin:
140
+ return "invalid"
141
+
123
142
  params = urlencode(
124
143
  {
125
144
  "gjz": project,
@@ -157,7 +176,7 @@ class FeiyunApp:
157
176
  return None
158
177
  elif text == "buzu":
159
178
  print(f"账号余额不足: {text}")
160
- return None
179
+ return "invalid"
161
180
  elif text and text.find(project) > -1:
162
181
  codes = self.extract_verification_codes(text)
163
182
  if codes:
@@ -172,7 +191,7 @@ class FeiyunApp:
172
191
 
173
192
  def extract_verification_codes(self, text):
174
193
  """
175
- 从文本中提取所有独立的 4 位或 6 位数字验证码。
194
+ 从文本中提取所有独立的 4 位、5 位或 6 位数字验证码。
176
195
 
177
196
  参数:
178
197
  text (str): 输入的文本字符串
@@ -182,8 +201,8 @@ class FeiyunApp:
182
201
  """
183
202
  # 正则表达式解释:
184
203
  # \b : 单词边界,确保数字前后不是其他数字或字母(防止匹配长数字的一部分)
185
- # (\d{4}|\d{6}) : 匹配恰好 4 恰好 6 位的数字
186
- pattern = r"\b(\d{4}|\d{6})\b"
204
+ # (\d{4}|\d{5}|\d{6}) : 匹配恰好 4 位、5 位或 6 位的数字
205
+ pattern = r"\b(\d{4}|\d{5}|\d{6})\b"
187
206
 
188
207
  matches = re.findall(pattern, text)
189
208
  return matches
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyscriptbase
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: python script base library
5
5
  Home-page:
6
6
  Author: ASMan
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pyscriptbase", # 包名
5
- version="1.1.4", # 版本号
5
+ version="1.1.5", # 版本号
6
6
  packages=find_packages(), # 自动查找包
7
7
  author="ASMan",
8
8
  author_email="",
@@ -23,6 +23,6 @@ setup(
23
23
  "beautifulsoup4",
24
24
  "requests",
25
25
  "lxml",
26
- "brotli"
26
+ "brotli",
27
27
  ], # 依赖包列表
28
28
  )
File without changes
File without changes
File without changes