xtn-tools-pro 1.0.0.7.7__py3-none-any.whl → 1.0.0.7.8__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.
@@ -33,11 +33,12 @@ class GoFunTaskV3:
33
33
  processes_num = ini_dict.get('processes_num', 0) # 进程数
34
34
  thread_num = ini_dict.get('thread_num', 0) # 线程数
35
35
  restart_time = ini_dict.get('restart_time', 0) # 间隔x秒强制重启
36
- restart_time = 30 * 60 if restart_time <= 0 else restart_time # 间隔x秒强制重启时间不传默认60分钟
36
+ restart_time = 60 * 60 if restart_time <= 0 else restart_time # 间隔x秒强制重启时间不传默认60分钟
37
37
  update_proxies_time = ini_dict.get('update_proxies_time', 0) # 间隔x秒更新代理
38
38
  upload_task_time = ini_dict.get('upload_task_time', 0) # 回写间隔
39
- download_not_task_time = ini_dict.get('download_not_task_time', 0) # 当遇到下载任务接口返回空任务时,间隔x秒再继续请求,默认2秒
40
- download_not_task_time = 2 if download_not_task_time <= 0 else download_not_task_time # 当遇到下载任务接口返回空任务时,间隔x秒再继续请求,默认2秒
39
+ download_not_task_time = ini_dict.get('download_not_task_time', 0) # 当遇到下载任务接口返回空任务时,间隔x秒再继续请求
40
+ download_task_qsize = ini_dict.get('download_task_qsize', 10) # 触发下载任务队列的最低阈值(当下载队列小于等于x时就立刻请求下载任务接口获取任务),默认10个
41
+ download_task_qsize = 10 if download_task_qsize < 0 else download_task_qsize # 触发下载任务队列的最低阈值(当下载队列小于等于x时就立刻请求下载任务接口获取任务),默认10个
41
42
 
42
43
  # 默认进程数和线程数
43
44
  processes_num = 1 if processes_num <= 0 else processes_num
@@ -72,6 +73,7 @@ class GoFunTaskV3:
72
73
  "update_proxy_url": update_proxy_url, # 更新代理地址
73
74
  "external_ip": external_ip,
74
75
  "download_not_task_time": download_not_task_time,
76
+ "download_task_qsize": download_task_qsize,
75
77
  }
76
78
 
77
79
  logger.debug(
@@ -152,7 +154,8 @@ class GoFunTaskV3:
152
154
  logger.info("检测到已达强制重启间隔,正在重启...")
153
155
  self.manager_info["gofun_kill_status"] = True
154
156
 
155
- logger.info(f"主线程正常...{len(go_process_list)}...{self.manager_info['gofun_kill_status']}")
157
+ logger.info(
158
+ f"主线程正常...进程数:{len(go_process_list)}...gofun(True不存在|False正常):{self.manager_info['gofun_kill_status']}")
156
159
  time.sleep(10)
157
160
 
158
161
  def __get_external_ip(self):
@@ -179,6 +182,7 @@ class GoFunTaskV3:
179
182
  auto = ini_info["auto"]
180
183
  task = ini_info["task"]
181
184
  download_not_task_time = ini_info["download_not_task_time"]
185
+ download_task_qsize = ini_info["download_task_qsize"]
182
186
  headers = {"Authorization": auto}
183
187
  params = {"taskType": task}
184
188
 
@@ -187,7 +191,7 @@ class GoFunTaskV3:
187
191
  try:
188
192
  qsize = download_queue.qsize()
189
193
  logger.info(f"当前队列剩余任务数:{qsize}")
190
- if qsize >= 10:
194
+ if qsize > download_task_qsize:
191
195
  time.sleep(download_not_task_time)
192
196
  continue
193
197
  resp = requests.get(download_url, headers=headers, params=params, timeout=5)
@@ -363,3 +367,21 @@ class GoFunTaskV3:
363
367
  except Exception as e:
364
368
  self.logger.critical(f"update_upload_task 更新任务 {self.upload_queue, task_item} 报错 {e}")
365
369
  return False
370
+
371
+ def help(self):
372
+ help_txt = """
373
+ 参数说明:
374
+ host:必填,域名
375
+ port:选填,端口
376
+ task:必填,任务类型
377
+ auto:必填,token
378
+ proxies_dict:选填,默认为空,为空时会启动获取代理接口获取代理,不为空时则不启动该接口而是一直使用用户传递过来的代理
379
+ update_proxies_time:选填,默认为0,间隔x秒更新代理,0则每次启动时获取一次之后就不在请求代理接口
380
+ processes_num:选填,进程数,默认1
381
+ thread_num:选填,线程数,默认1
382
+ restart_time:选填,间隔x秒强制重启,默认60分钟
383
+ upload_task_time:选填,回写间隔,默认0
384
+ download_not_task_time:选填,默认0,当遇到下载任务接口返回空任务时,间隔x秒再继续请求
385
+ download_task_qsize:选填,默认10,触发下载任务队列的最低阈值(当下载队列小于等于x时就立刻请求下载任务接口获取任务),默认10个
386
+ """
387
+ self.logger.info(help_txt)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtn-tools-pro
3
- Version: 1.0.0.7.7
3
+ Version: 1.0.0.7.8
4
4
  Summary: xtn 开发工具
5
5
  Author: xtn
6
6
  Author-email: czw011122@gmail.com
@@ -12,7 +12,7 @@ xtn_tools_pro/proxy/proxy.py,sha256=No6E1pFY5yx2F4976pXPrLtq-QEVp79KupzcufjSN58,
12
12
  xtn_tools_pro/task_pro/__init__.py,sha256=nK3U47hWwE1H875ieEToH9r-jzXHS-PXk8cDstOvRE8,418
13
13
  xtn_tools_pro/task_pro/go_fun.py,sha256=hWEt2uJ9FCvJH7PhVZttS-11A7J6zbRKwX7c5YLYQag,19144
14
14
  xtn_tools_pro/task_pro/go_fun_v2.py,sha256=SgcXgtEBGSVL1V2LyqO0z8Md2H8JZxucYrLLIwqtiLM,18489
15
- xtn_tools_pro/task_pro/go_fun_v3.py,sha256=v8w6EayuhUcHQxJ0m7XFExI3cV_JZZaFIxhsTX4JxH4,16406
15
+ xtn_tools_pro/task_pro/go_fun_v3.py,sha256=Pd_FFKxd7GdiNxc-3x7U0q7OBBHD7N5QH692XchwWts,17883
16
16
  xtn_tools_pro/utils/__init__.py,sha256=I1_n_NP23F2lBqlF4EOlnOdLYxM8M4pbn63UhJN1hRE,418
17
17
  xtn_tools_pro/utils/crypto.py,sha256=oyzFqWum_oimUtzhfVCELQhdMjxDbLu-nOWfcNmazcc,4087
18
18
  xtn_tools_pro/utils/file_utils.py,sha256=obaBP7CaBCsXxzqGeWzV2l0yw7vicgKOaXzmpMV8ips,2567
@@ -22,8 +22,8 @@ xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,
22
22
  xtn_tools_pro/utils/set_data.py,sha256=IthfAclck7AbaxOIKOgJZ2wdcfEmlvC-C63Tywcr4bA,11180
23
23
  xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
24
24
  xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
25
- xtn_tools_pro-1.0.0.7.7.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- xtn_tools_pro-1.0.0.7.7.dist-info/METADATA,sha256=9IZ1bUfo7MvRmyO-rJot0uDqpV5sEnqMtgyK4TmrWAo,498
27
- xtn_tools_pro-1.0.0.7.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
28
- xtn_tools_pro-1.0.0.7.7.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
29
- xtn_tools_pro-1.0.0.7.7.dist-info/RECORD,,
25
+ xtn_tools_pro-1.0.0.7.8.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ xtn_tools_pro-1.0.0.7.8.dist-info/METADATA,sha256=iL7cELlsKjZXE79i-3a39WXwE7drXBsjOvmv4_KpoPM,498
27
+ xtn_tools_pro-1.0.0.7.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
28
+ xtn_tools_pro-1.0.0.7.8.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
29
+ xtn_tools_pro-1.0.0.7.8.dist-info/RECORD,,