xtn-tools-pro 1.0.1.1.0__py3-none-any.whl → 1.0.1.1.2__py3-none-any.whl
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.
- xtn_tools_pro/task_pro/go_fun_v3.py +20 -0
- xtn_tools_pro/utils/crypto.py +12 -2
- xtn_tools_pro/utils/helpers.py +0 -39
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/METADATA +2 -1
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/RECORD +9 -9
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/LICENSE +0 -0
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/WHEEL +0 -0
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/entry_points.txt +0 -0
- {xtn_tools_pro-1.0.1.1.0.dist-info → xtn_tools_pro-1.0.1.1.2.dist-info}/top_level.txt +0 -0
@@ -108,6 +108,7 @@ class GoFunTaskV3:
|
|
108
108
|
# go_task_fun_cnt = 0
|
109
109
|
# go_task_fun_task_process = None
|
110
110
|
self.manager_info["gofun_kill_status"] = False # 进程kill状态,True需要kill/False无需kill
|
111
|
+
self.manager_info["gofun_kill_status_qz"] = False # 进程 强制 kill状态,True需要kill/False无需kill
|
111
112
|
self.manager_info["gofun_run_status_time"] = get_time_now_timestamp(is_time_10=True)
|
112
113
|
|
113
114
|
go_process_list = []
|
@@ -154,6 +155,16 @@ class GoFunTaskV3:
|
|
154
155
|
logger.info("检测到已达强制重启间隔,正在重启...")
|
155
156
|
self.manager_info["gofun_kill_status"] = True
|
156
157
|
|
158
|
+
if self.manager_info["gofun_kill_status_qz"]:
|
159
|
+
for p in go_process_list:
|
160
|
+
# p.terminate()
|
161
|
+
p.join()
|
162
|
+
go_process_list = []
|
163
|
+
go_task_status_error = 0
|
164
|
+
logger.info("检测到强制关闭指令,关闭gofun成功!!!")
|
165
|
+
self.manager_info["gofun_kill_status_qz"] = False
|
166
|
+
|
167
|
+
|
157
168
|
logger.info(
|
158
169
|
f"主线程正常...进程数:{len(go_process_list)}...gofun(True不存在|False正常):{self.manager_info['gofun_kill_status']}")
|
159
170
|
time.sleep(10)
|
@@ -187,11 +198,20 @@ class GoFunTaskV3:
|
|
187
198
|
params = {"taskType": task}
|
188
199
|
logger.warning("下载队列启动成功...")
|
189
200
|
download_queue_exist_cnt = 3
|
201
|
+
now_qsize_v = None
|
202
|
+
now_qsize_v_time = None
|
190
203
|
while True:
|
191
204
|
try:
|
192
205
|
qsize = download_queue.qsize()
|
193
206
|
logger.info(f"当前队列剩余任务数:{qsize}")
|
194
207
|
if qsize > download_task_qsize:
|
208
|
+
if not now_qsize_v or qsize != now_qsize_v:
|
209
|
+
now_qsize_v = qsize
|
210
|
+
now_qsize_v_time = get_time_now_timestamp(is_time_10=True)
|
211
|
+
|
212
|
+
if now_qsize_v_time + (60 * 5) < get_time_now_timestamp(is_time_10=True):
|
213
|
+
manager_info["gofun_kill_status"] = True
|
214
|
+
|
195
215
|
time.sleep(download_not_task_time)
|
196
216
|
continue
|
197
217
|
resp = requests.get(download_url, headers=headers, params=params, timeout=5)
|
xtn_tools_pro/utils/crypto.py
CHANGED
@@ -9,10 +9,10 @@
|
|
9
9
|
# 2024/5/13 xiatn V00.01.000 新建
|
10
10
|
# --------------------------------------------------------------------------------------------------
|
11
11
|
import jwt
|
12
|
+
import pyotp
|
12
13
|
import base64
|
13
14
|
import hashlib
|
14
15
|
import secrets
|
15
|
-
import datetime
|
16
16
|
|
17
17
|
|
18
18
|
def get_md5_32(s: str, is_upper=False):
|
@@ -166,5 +166,15 @@ def img_str_to_bytes(img_data: str):
|
|
166
166
|
return img_data.encode('latin1')
|
167
167
|
|
168
168
|
|
169
|
+
def get_2FA(secret):
|
170
|
+
"""
|
171
|
+
计算 2FA
|
172
|
+
:param secret:
|
173
|
+
:return:
|
174
|
+
"""
|
175
|
+
totp = pyotp.TOTP(secret)
|
176
|
+
return str(totp.now())
|
177
|
+
|
178
|
+
|
169
179
|
if __name__ == '__main__':
|
170
|
-
print(
|
180
|
+
print(get_2FA('ninqzrh367u3iahpi2mum36bgfvouv5m'))
|
xtn_tools_pro/utils/helpers.py
CHANGED
@@ -142,49 +142,10 @@ def get_orderId_random(prefix="", suffix=""):
|
|
142
142
|
return f"{prefix}{combined_number}{suffix}"
|
143
143
|
|
144
144
|
|
145
|
-
def get_xxx():
|
146
|
-
return "get_xxx"
|
147
145
|
|
148
146
|
|
149
|
-
def get_xxx1():
|
150
|
-
return "get_xxx1"
|
151
147
|
|
152
148
|
|
153
|
-
def get_xxx2():
|
154
|
-
return "get_xxx2"
|
155
|
-
|
156
|
-
|
157
|
-
def get_xxx3():
|
158
|
-
return "get_xxx3"
|
159
|
-
|
160
|
-
|
161
|
-
def get_xxx4():
|
162
|
-
return "get_xxx4"
|
163
|
-
|
164
|
-
|
165
|
-
def get_xxx5():
|
166
|
-
return "get_xxx5"
|
167
|
-
|
168
|
-
|
169
|
-
def get_xxx6():
|
170
|
-
return "get_xxx6"
|
171
|
-
|
172
|
-
|
173
|
-
def get_xxx7():
|
174
|
-
return "get_xxx7"
|
175
|
-
|
176
|
-
|
177
|
-
def get_xxx8():
|
178
|
-
return "get_xxx8"
|
179
|
-
|
180
|
-
|
181
|
-
def get_xxx9():
|
182
|
-
return "get_xxx9"
|
183
|
-
|
184
|
-
|
185
|
-
def get_xxx10():
|
186
|
-
return "get_xxx10"
|
187
|
-
|
188
149
|
|
189
150
|
if __name__ == '__main__':
|
190
151
|
# print(get_uuid(4))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: xtn-tools-pro
|
3
|
-
Version: 1.0.1.1.
|
3
|
+
Version: 1.0.1.1.2
|
4
4
|
Summary: xtn 开发工具
|
5
5
|
Author: xtn
|
6
6
|
Author-email: czw011122@gmail.com
|
@@ -18,5 +18,6 @@ Requires-Dist: Faker
|
|
18
18
|
Requires-Dist: PyJWT
|
19
19
|
Requires-Dist: tqdm
|
20
20
|
Requires-Dist: fabric
|
21
|
+
Requires-Dist: pyotp
|
21
22
|
|
22
23
|
xtnkk-tools
|
@@ -51,20 +51,20 @@ xtn_tools_pro/task_pro/__init__.py,sha256=nK3U47hWwE1H875ieEToH9r-jzXHS-PXk8cDst
|
|
51
51
|
xtn_tools_pro/task_pro/go_fun.py,sha256=hWEt2uJ9FCvJH7PhVZttS-11A7J6zbRKwX7c5YLYQag,19144
|
52
52
|
xtn_tools_pro/task_pro/go_fun_air_v1.py,sha256=25gHmW5aAV6nMY9Y6-wD7uQ_wqE39dr-eaegqVbYKM8,11035
|
53
53
|
xtn_tools_pro/task_pro/go_fun_v2.py,sha256=SgcXgtEBGSVL1V2LyqO0z8Md2H8JZxucYrLLIwqtiLM,18489
|
54
|
-
xtn_tools_pro/task_pro/go_fun_v3.py,sha256=
|
54
|
+
xtn_tools_pro/task_pro/go_fun_v3.py,sha256=QHOb_5z1nS4LQmUIXgI4G4TWuHk0L4JxI1TQEJO-sI4,19744
|
55
55
|
xtn_tools_pro/utils/__init__.py,sha256=I1_n_NP23F2lBqlF4EOlnOdLYxM8M4pbn63UhJN1hRE,418
|
56
|
-
xtn_tools_pro/utils/crypto.py,sha256=
|
56
|
+
xtn_tools_pro/utils/crypto.py,sha256=fyqno82Tw8LeF5i8YiEpjPI3oswsqTeWE5Lc9M2ef68,4603
|
57
57
|
xtn_tools_pro/utils/file_utils.py,sha256=obaBP7CaBCsXxzqGeWzV2l0yw7vicgKOaXzmpMV8ips,2567
|
58
|
-
xtn_tools_pro/utils/helpers.py,sha256=
|
58
|
+
xtn_tools_pro/utils/helpers.py,sha256=0CTMY7wfSQR_DC9-v1lkKQLpWcB1FL9V_kw_5DOcZ40,4454
|
59
59
|
xtn_tools_pro/utils/log.py,sha256=mf5huJDA8xVxxFWPG_tl_vOsAA2_ywGDFycYSGHIDCo,10202
|
60
60
|
xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
|
61
61
|
xtn_tools_pro/utils/set_data.py,sha256=BzCLbEDO83csDHBey8kP7SoE6kx6EjqE7OqRBY7k82s,17608
|
62
62
|
xtn_tools_pro/utils/shell.py,sha256=2SeC620Fj2Gi4bSWmr6w9-OjOBR1MB_OfTEz5HIwK-k,2940
|
63
63
|
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
64
64
|
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
65
|
-
xtn_tools_pro-1.0.1.1.
|
66
|
-
xtn_tools_pro-1.0.1.1.
|
67
|
-
xtn_tools_pro-1.0.1.1.
|
68
|
-
xtn_tools_pro-1.0.1.1.
|
69
|
-
xtn_tools_pro-1.0.1.1.
|
70
|
-
xtn_tools_pro-1.0.1.1.
|
65
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/METADATA,sha256=Vqscm8H2d0-WoMh44YgeE-VNIekELf7Gh4_lxtkLQJw,545
|
67
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
68
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
69
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
70
|
+
xtn_tools_pro-1.0.1.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|