ryry-cli 2.75__tar.gz → 2.77__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.
- {ryry_cli-2.75 → ryry_cli-2.77}/PKG-INFO +1 -1
- ryry_cli-2.77/ryry/constant.py +4 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_server_socket.py +13 -3
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_webapi.py +33 -8
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/upload.py +2 -2
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.75 → ryry_cli-2.77}/setup.py +1 -1
- ryry_cli-2.75/ryry/constant.py +0 -4
- {ryry_cli-2.75 → ryry_cli-2.77}/LICENSE +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/README.md +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/__init__.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/main.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/ryry_widget.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/server_func.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/store.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/task.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry/utils.py +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.75 → ryry_cli-2.77}/setup.cfg +0 -0
|
@@ -169,12 +169,13 @@ class RyryShortConnectThread(Thread):
|
|
|
169
169
|
|
|
170
170
|
def run(self):
|
|
171
171
|
print(f" {self.name} start")
|
|
172
|
-
min_wait_time =
|
|
173
|
-
max_wait_time =
|
|
172
|
+
min_wait_time = 5
|
|
173
|
+
max_wait_time = 60
|
|
174
174
|
wait_time = min_wait_time
|
|
175
|
-
consecutive_step =
|
|
175
|
+
consecutive_step = 10
|
|
176
176
|
consecutive_failures = 0
|
|
177
177
|
max_consecutive_failures = 10
|
|
178
|
+
last_check_time = 0
|
|
178
179
|
|
|
179
180
|
while (self.is_running):
|
|
180
181
|
try:
|
|
@@ -194,6 +195,15 @@ class RyryShortConnectThread(Thread):
|
|
|
194
195
|
if consecutive_failures >= max_consecutive_failures:
|
|
195
196
|
wait_time = min(max_wait_time, wait_time + consecutive_step)
|
|
196
197
|
consecutive_failures = 0
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
if calendar.timegm(time.gmtime()) - last_check_time > 600:
|
|
201
|
+
last_check_time = calendar.timegm(time.gmtime())
|
|
202
|
+
try:
|
|
203
|
+
min_wait_time, max_wait_time, consecutive_step = ryry_webapi.TaskConfig()
|
|
204
|
+
except:
|
|
205
|
+
pass
|
|
206
|
+
|
|
197
207
|
except Exception as ex:
|
|
198
208
|
taskUtils.taskPrint(None, f"{self.name} === exception : {ex}")
|
|
199
209
|
time.sleep(wait_time)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import json, os
|
|
2
|
-
import
|
|
3
|
-
import uuid, requests
|
|
4
|
-
import calendar, time
|
|
1
|
+
import json, os, locale, datetime, platform
|
|
2
|
+
import uuid, requests, calendar, time
|
|
5
3
|
|
|
6
4
|
from ryry import store
|
|
7
5
|
from ryry import utils
|
|
@@ -36,11 +34,38 @@ def _aigc_post(func, params, files={}, timeout=10):
|
|
|
36
34
|
return -1, "", ""
|
|
37
35
|
|
|
38
36
|
#======================================== Task Function ==============================
|
|
37
|
+
def ServerTaskConfig():
|
|
38
|
+
r1, r2, r3 = _aigc_post("aigc/task/config", {})
|
|
39
|
+
if r1 != 0:
|
|
40
|
+
raise Exception("")
|
|
41
|
+
|
|
42
|
+
min_wait_time = r3["min_wait_time"]
|
|
43
|
+
max_wait_time = r3["max_wait_time"]
|
|
44
|
+
consecutive_step = r3["step"]
|
|
45
|
+
return min_wait_time, max_wait_time, consecutive_step
|
|
46
|
+
|
|
47
|
+
GLOBAL_EXT_JSON = "{}"
|
|
39
48
|
def _extend():
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
global GLOBAL_EXT_JSON
|
|
50
|
+
if len(GLOBAL_EXT_JSON) < 10:
|
|
51
|
+
extInfo = store.readDeviceInfo()
|
|
52
|
+
extInfo["app"] = constant.app_name + " " + constant.app_version
|
|
53
|
+
extInfo["device"] = platform.system()
|
|
54
|
+
extInfo["device_version"] = platform.version()
|
|
55
|
+
extInfo["device_name"] = platform.node()
|
|
56
|
+
extInfo["device_model"] = platform.machine()
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
extInfo["ip_address"] = requests.get('https://api.ipify.org').text
|
|
60
|
+
except Exception as e:
|
|
61
|
+
extInfo["ip_address"] = "unknown"
|
|
62
|
+
|
|
63
|
+
system_language, _ = locale.getdefaultlocale()
|
|
64
|
+
system_platform = platform.system().lower()
|
|
65
|
+
extInfo["language"] = system_language if system_language else "unknown"
|
|
66
|
+
extInfo["platform"] = system_platform if system_platform else "unknown"
|
|
67
|
+
GLOBAL_EXT_JSON = json.dumps(extInfo)
|
|
68
|
+
return GLOBAL_EXT_JSON
|
|
44
69
|
|
|
45
70
|
def GetTask():
|
|
46
71
|
widget_map = []
|
|
@@ -155,14 +155,14 @@ def getSubdomain(targetDomain):
|
|
|
155
155
|
for ip in SUBDOMAIN.keys():
|
|
156
156
|
for host_item in SUBDOMAIN[ip]:
|
|
157
157
|
if targetDomain == host_item["readpath"]:
|
|
158
|
-
if _can_connect_ftp(ip, host_item["
|
|
158
|
+
if _can_connect_ftp(ip, host_item["port"], host_item["username"], host_item["password"], host_item["writepath"]):
|
|
159
159
|
return host_item
|
|
160
160
|
return None
|
|
161
161
|
|
|
162
162
|
def getFirstSupportSubdomain():
|
|
163
163
|
for ip in SUBDOMAIN.keys():
|
|
164
164
|
for host_item in SUBDOMAIN[ip]:
|
|
165
|
-
if _can_connect_ftp(ip, host_item["
|
|
165
|
+
if _can_connect_ftp(ip, host_item["port"], host_item["username"], host_item["password"], host_item["writepath"]):
|
|
166
166
|
return host_item
|
|
167
167
|
return None
|
|
168
168
|
|
ryry_cli-2.75/ryry/constant.py
DELETED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|