ryry-cli 2.64__tar.gz → 2.66__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.64 → ryry_cli-2.66}/PKG-INFO +1 -1
- ryry_cli-2.66/ryry/constant.py +4 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/upload.py +77 -56
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.64 → ryry_cli-2.66}/setup.py +1 -1
- ryry_cli-2.64/ryry/constant.py +0 -4
- {ryry_cli-2.64 → ryry_cli-2.66}/LICENSE +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/README.md +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/__init__.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/main.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/ryry_widget.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/server_func.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/store.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/task.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry/utils.py +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.64 → ryry_cli-2.66}/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,54 +122,68 @@ 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
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
|
|
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.update({
|
|
162
|
+
"path_replace": [ "/mcn/videos/", "/mcn/" ]
|
|
163
|
+
}),
|
|
164
|
+
ftp_183_6_90_205.update({
|
|
165
|
+
"path_replace": [ "/mcn/videos/", "/mcn/" ]
|
|
166
|
+
})
|
|
137
167
|
],
|
|
138
168
|
"192.168.50.113": [
|
|
139
|
-
{
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
},
|
|
169
|
+
ftp_172_16_3_215.update({
|
|
170
|
+
"path_replace": [ "/mcn/", "/mcn/videos/" ]
|
|
171
|
+
}),
|
|
172
|
+
ftp_192_168_50_113,
|
|
173
|
+
ftp_183_6_90_205,
|
|
155
174
|
],
|
|
156
175
|
"183.6.90.205": [
|
|
157
|
-
{
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"username" : "ftpuser",
|
|
169
|
-
"password" : "ftpuser",
|
|
170
|
-
"writepath" : "cache/",
|
|
171
|
-
"readpath" : "ftp://192.168.50.113/cache"
|
|
172
|
-
},
|
|
176
|
+
ftp_172_16_3_215.update({
|
|
177
|
+
"path_replace": [ "/mcn/", "/mcn/videos/" ]
|
|
178
|
+
}),
|
|
179
|
+
ftp_192_168_50_113,
|
|
180
|
+
ftp_183_6_90_205,
|
|
181
|
+
],
|
|
182
|
+
"192.168.3.220": [
|
|
183
|
+
ftp_172_16_3_215.update({
|
|
184
|
+
"path_replace": [ "/mcn/", "/mcn/videos/" ]
|
|
185
|
+
}),
|
|
186
|
+
ftp_192_168_3_220
|
|
173
187
|
]
|
|
174
188
|
}
|
|
175
189
|
|
|
@@ -213,11 +227,14 @@ def download(url, saveDir):
|
|
|
213
227
|
password = host_item["password"]
|
|
214
228
|
writepath = host_item["writepath"]
|
|
215
229
|
readpath = host_item["readpath"]
|
|
230
|
+
replace_path = host_item.get("path_replace", [])
|
|
216
231
|
ftp = ftplib.FTP()
|
|
217
|
-
ftp.connect(ip, port, timeout=
|
|
218
|
-
ftp.login(username, password)
|
|
232
|
+
ftp.connect(ip, port, timeout=5)
|
|
233
|
+
ftp.login(username, password)
|
|
219
234
|
|
|
220
235
|
remote_filepath = parsed_url.path[1:]
|
|
236
|
+
if len(replace_path) > 0:
|
|
237
|
+
remote_filepath = remote_filepath.replace(replace_path[0], replace_path[1])
|
|
221
238
|
if "." in urlparser.urlparse(url).path:
|
|
222
239
|
ext = urlparser.urlparse(url).path[urlparser.urlparse(url).path.index("."):]
|
|
223
240
|
savePath = os.path.join(saveDir, f"{name}{ext}")
|
|
@@ -278,11 +295,14 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
278
295
|
port = host_item["port"]
|
|
279
296
|
username = host_item["username"]
|
|
280
297
|
password = host_item["password"]
|
|
298
|
+
replace_path = host_item.get("path_replace", [])
|
|
281
299
|
ftp = ftplib.FTP()
|
|
282
|
-
ftp.connect(ip, port, timeout=
|
|
300
|
+
ftp.connect(ip, port, timeout=5)
|
|
283
301
|
ftp.login(username, password)
|
|
284
302
|
|
|
285
303
|
remote_filepath = parsed_url.path[1:]
|
|
304
|
+
if len(replace_path) > 0:
|
|
305
|
+
remote_filepath = remote_filepath.replace(replace_path[0], replace_path[1])
|
|
286
306
|
if remote_filepath[-1:] != "/":
|
|
287
307
|
remote_filepath += "/"
|
|
288
308
|
ftp.cwd(remote_filepath)
|
|
@@ -295,18 +315,19 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
295
315
|
for file in files:
|
|
296
316
|
with open(os.path.join(savePath, file), 'wb') as f:
|
|
297
317
|
ftp.retrbinary(f'RETR {file}', f.write)
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
ftp.quit()
|
|
318
|
+
if autoDelete:
|
|
319
|
+
try:
|
|
320
|
+
ftp.delete(file)
|
|
321
|
+
except Exception as e:
|
|
322
|
+
print(f"Error deleting file {file}: {e}")
|
|
323
|
+
ftp.quit()
|
|
304
324
|
return savePath
|
|
305
|
-
except:
|
|
325
|
+
except Exception as ex:
|
|
326
|
+
print(ex)
|
|
306
327
|
pass
|
|
307
328
|
print(f"downloadDir fail: domain {host} not support")
|
|
308
329
|
else:
|
|
309
330
|
print(f"url {url} not support")
|
|
310
331
|
except Exception as e:
|
|
311
332
|
print(f"downloadDir fail: {e}")
|
|
312
|
-
return None
|
|
333
|
+
return None
|
ryry_cli-2.64/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
|