ryry-cli 2.63__tar.gz → 2.65__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.63 → ryry_cli-2.65}/PKG-INFO +1 -1
- ryry_cli-2.65/ryry/constant.py +4 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/upload.py +69 -60
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.63 → ryry_cli-2.65}/setup.py +1 -1
- ryry_cli-2.63/ryry/constant.py +0 -4
- {ryry_cli-2.63 → ryry_cli-2.65}/LICENSE +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/README.md +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/__init__.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/main.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/ryry_widget.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/server_func.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/store.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/task.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry/utils.py +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.63 → ryry_cli-2.65}/setup.cfg +0 -0
|
@@ -97,7 +97,7 @@ def ftpUpload(file, new_file_name, subdomain):
|
|
|
97
97
|
readpath = subdomain["readpath"]
|
|
98
98
|
import ftplib
|
|
99
99
|
ftp = ftplib.FTP()
|
|
100
|
-
ftp.connect(ip, port, timeout=
|
|
100
|
+
ftp.connect(ip, port, timeout=5)
|
|
101
101
|
ftp.login(username, password)
|
|
102
102
|
|
|
103
103
|
s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
|
|
@@ -108,7 +108,7 @@ def _can_connect_ftp(ip, port, username, password, writepath):
|
|
|
108
108
|
import ftplib
|
|
109
109
|
try:
|
|
110
110
|
ftp = ftplib.FTP()
|
|
111
|
-
ftp.connect(ip, port, timeout=
|
|
111
|
+
ftp.connect(ip, port, timeout=5)
|
|
112
112
|
ftp.login(username, password)
|
|
113
113
|
try:
|
|
114
114
|
ftp.cwd(writepath)
|
|
@@ -122,71 +122,79 @@ def _can_connect_ftp(ip, port, username, password, writepath):
|
|
|
122
122
|
except Exception as e:
|
|
123
123
|
print(f"Failed to connect to FTP server {ip}:{writepath} {e}")
|
|
124
124
|
return False
|
|
125
|
-
|
|
125
|
+
ftp_172_16_3_215={
|
|
126
|
+
"host" : "172.16.3.215",
|
|
127
|
+
"port": 21,
|
|
128
|
+
"username" : "admin",
|
|
129
|
+
"password" : "Mecord@2024",
|
|
130
|
+
"writepath" : "mcn/cache",
|
|
131
|
+
"readpath" : "ftp://172.16.3.215/mcn/cache"
|
|
132
|
+
}
|
|
133
|
+
ftp_192_168_3_220={
|
|
134
|
+
"host": "192.168.3.220",
|
|
135
|
+
"port": 21,
|
|
136
|
+
"username" : "xinyu100",
|
|
137
|
+
"password" : "xinyu100.com",
|
|
138
|
+
"writepath" : "1TB01/data/cache/",
|
|
139
|
+
# "readpath" : "http://192.168.3.220/01/cache"
|
|
140
|
+
"readpath" : "ftp://192.168.3.220/1TB01/data/cache"
|
|
141
|
+
}
|
|
142
|
+
ftp_183_6_90_205={
|
|
143
|
+
"host" : "183.6.90.205",
|
|
144
|
+
"port": 13210,
|
|
145
|
+
"username" : "ftpuser",
|
|
146
|
+
"password" : "ftpuser",
|
|
147
|
+
"writepath" : "cache/",
|
|
148
|
+
"readpath" : "ftp://183.6.90.205:13210/cache"
|
|
149
|
+
}
|
|
150
|
+
ftp_192_168_50_113={
|
|
151
|
+
"host" : "192.168.50.113",
|
|
152
|
+
"port": 21,
|
|
153
|
+
"username" : "ftpuser",
|
|
154
|
+
"password" : "ftpuser",
|
|
155
|
+
"writepath" : "cache/",
|
|
156
|
+
"readpath" : "ftp://192.168.50.113/cache"
|
|
157
|
+
}
|
|
126
158
|
SUBDOMAIN = {
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"username" : "xinyu100",
|
|
132
|
-
"password" : "xinyu100.com",
|
|
133
|
-
"writepath" : "1TB01/data/cache/",
|
|
134
|
-
# "readpath" : "http://192.168.3.220/01/cache"
|
|
135
|
-
"readpath" : "ftp://192.168.3.220/1TB01/data/cache"
|
|
136
|
-
}
|
|
159
|
+
"172.16.3.215": [
|
|
160
|
+
ftp_172_16_3_215,
|
|
161
|
+
ftp_192_168_50_113,
|
|
162
|
+
ftp_183_6_90_205
|
|
137
163
|
],
|
|
138
164
|
"192.168.50.113": [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"username" : "ftpuser",
|
|
143
|
-
"password" : "ftpuser",
|
|
144
|
-
"writepath" : "cache/",
|
|
145
|
-
"readpath" : "ftp://192.168.50.113/cache"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"host" : "183.6.90.205",
|
|
149
|
-
"port": 13210,
|
|
150
|
-
"username" : "ftpuser",
|
|
151
|
-
"password" : "ftpuser",
|
|
152
|
-
"writepath" : "cache/",
|
|
153
|
-
"readpath" : "ftp://192.168.50.113/cache"
|
|
154
|
-
},
|
|
165
|
+
ftp_172_16_3_215,
|
|
166
|
+
ftp_192_168_50_113,
|
|
167
|
+
ftp_183_6_90_205,
|
|
155
168
|
],
|
|
156
169
|
"183.6.90.205": [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"host" : "183.6.90.205",
|
|
167
|
-
"port": 13210,
|
|
168
|
-
"username" : "ftpuser",
|
|
169
|
-
"password" : "ftpuser",
|
|
170
|
-
"writepath" : "cache/",
|
|
171
|
-
"readpath" : "ftp://192.168.50.113/cache"
|
|
172
|
-
},
|
|
170
|
+
ftp_172_16_3_215,
|
|
171
|
+
ftp_192_168_50_113,
|
|
172
|
+
ftp_183_6_90_205,
|
|
173
|
+
],
|
|
174
|
+
"192.168.3.220": [
|
|
175
|
+
ftp_172_16_3_215,
|
|
176
|
+
ftp_192_168_3_220
|
|
173
177
|
]
|
|
174
178
|
}
|
|
179
|
+
|
|
175
180
|
def getSubdomain(targetDomain):
|
|
176
181
|
if len(targetDomain) <= 0:
|
|
177
182
|
return None
|
|
178
183
|
for ip in SUBDOMAIN.keys():
|
|
179
|
-
|
|
180
|
-
if
|
|
181
|
-
|
|
184
|
+
for host_item in SUBDOMAIN[ip]:
|
|
185
|
+
if targetDomain == host_item["readpath"]:
|
|
186
|
+
if _can_connect_ftp(ip, host_item["username"], host_item["port"], host_item["password"], host_item["writepath"]):
|
|
187
|
+
return host_item
|
|
182
188
|
return None
|
|
183
189
|
|
|
184
190
|
def getFirstSupportSubdomain():
|
|
185
191
|
for ip in SUBDOMAIN.keys():
|
|
186
|
-
|
|
187
|
-
|
|
192
|
+
for host_item in SUBDOMAIN[ip]:
|
|
193
|
+
if _can_connect_ftp(ip, host_item["username"], host_item["port"], host_item["password"], host_item["writepath"]):
|
|
194
|
+
return host_item
|
|
188
195
|
return None
|
|
189
196
|
|
|
197
|
+
|
|
190
198
|
def download(url, saveDir):
|
|
191
199
|
import uuid, requests, os
|
|
192
200
|
from urlparser import urlparser
|
|
@@ -210,7 +218,7 @@ def download(url, saveDir):
|
|
|
210
218
|
writepath = host_item["writepath"]
|
|
211
219
|
readpath = host_item["readpath"]
|
|
212
220
|
ftp = ftplib.FTP()
|
|
213
|
-
ftp.connect(ip, port, timeout=
|
|
221
|
+
ftp.connect(ip, port, timeout=5)
|
|
214
222
|
ftp.login(username, password)
|
|
215
223
|
|
|
216
224
|
remote_filepath = parsed_url.path[1:]
|
|
@@ -275,7 +283,7 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
275
283
|
username = host_item["username"]
|
|
276
284
|
password = host_item["password"]
|
|
277
285
|
ftp = ftplib.FTP()
|
|
278
|
-
ftp.connect(ip, port, timeout=
|
|
286
|
+
ftp.connect(ip, port, timeout=5)
|
|
279
287
|
ftp.login(username, password)
|
|
280
288
|
|
|
281
289
|
remote_filepath = parsed_url.path[1:]
|
|
@@ -291,18 +299,19 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
291
299
|
for file in files:
|
|
292
300
|
with open(os.path.join(savePath, file), 'wb') as f:
|
|
293
301
|
ftp.retrbinary(f'RETR {file}', f.write)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
ftp.quit()
|
|
302
|
+
if autoDelete:
|
|
303
|
+
try:
|
|
304
|
+
ftp.delete(file)
|
|
305
|
+
except Exception as e:
|
|
306
|
+
print(f"Error deleting file {file}: {e}")
|
|
307
|
+
ftp.quit()
|
|
300
308
|
return savePath
|
|
301
|
-
except:
|
|
309
|
+
except Exception as ex:
|
|
310
|
+
print(ex)
|
|
302
311
|
pass
|
|
303
312
|
print(f"downloadDir fail: domain {host} not support")
|
|
304
313
|
else:
|
|
305
314
|
print(f"url {url} not support")
|
|
306
315
|
except Exception as e:
|
|
307
316
|
print(f"downloadDir fail: {e}")
|
|
308
|
-
return None
|
|
317
|
+
return None
|
ryry_cli-2.63/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
|
|
File without changes
|
|
File without changes
|