ryry-cli 4.30__tar.gz → 5.0__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-4.30/ryry_cli.egg-info → ryry_cli-5.0}/PKG-INFO +2 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/constant.py +2 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/main.py +2 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/ryry_webapi.py +6 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/store.py +1 -1
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/upload.py +42 -15
- {ryry_cli-4.30 → ryry_cli-5.0/ryry_cli.egg-info}/PKG-INFO +2 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry_cli.egg-info/requires.txt +1 -1
- {ryry_cli-4.30 → ryry_cli-5.0}/setup.py +2 -2
- {ryry_cli-4.30 → ryry_cli-5.0}/LICENSE +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/README.md +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/__init__.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/daemon_base.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/daemon_manager.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/proxy_manager.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/ryry_service.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/ryry_widget.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/script_template/daemon.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/script_template/main.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/script_template/run.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/server_func.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/shared_memory.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/task.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/taskUtils.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry/utils.py +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-4.30 → ryry_cli-5.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ryry-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0
|
|
4
4
|
Summary: ryry tools
|
|
5
5
|
Home-page: https://github.com/dalipenMedia
|
|
6
6
|
Author: dalipen
|
|
@@ -25,7 +25,7 @@ Requires-Dist: urllib3
|
|
|
25
25
|
Requires-Dist: portalocker
|
|
26
26
|
Requires-Dist: PyYAML
|
|
27
27
|
Provides-Extra: with-mecord
|
|
28
|
-
Requires-Dist: mecord-cli>=0.7.
|
|
28
|
+
Requires-Dist: mecord-cli>=0.7.407; extra == "with-mecord"
|
|
29
29
|
|
|
30
30
|
ryry Python Tool
|
|
31
31
|
===============================================
|
|
@@ -207,8 +207,8 @@ def status():
|
|
|
207
207
|
service_status(None, 0)
|
|
208
208
|
print(scr_line("-" * ll*3))
|
|
209
209
|
device_status(None, 0)
|
|
210
|
-
print(scr_line("-" * ll*3))
|
|
211
|
-
proxy_status(None, 0)
|
|
210
|
+
# print(scr_line("-" * ll*3))
|
|
211
|
+
# proxy_status(None, 0)
|
|
212
212
|
print(scr_line("-" * ll*3))
|
|
213
213
|
widget_status(None, 0)
|
|
214
214
|
print(scr_line("-" * ll*3))
|
|
@@ -282,14 +282,18 @@ def _changeDomain(url, fix_domain):
|
|
|
282
282
|
# mecord_netloc = 'm.mecordai.com'
|
|
283
283
|
# mecord_url = parsed_url._replace(netloc=fix_domain)
|
|
284
284
|
|
|
285
|
-
def upload(localFilePath, ext, keepItAlways=False):
|
|
285
|
+
def upload(localFilePath, ext, keepItAlways=False, needTranscode=False, additionalUrl=False):
|
|
286
286
|
try:
|
|
287
287
|
return _upload(localFilePath, ext, keepItAlways=False)
|
|
288
288
|
except:
|
|
289
289
|
pass
|
|
290
290
|
from mecord import upload as mecord_upload
|
|
291
291
|
try:
|
|
292
|
-
url = mecord_upload.upload(localFilePath,
|
|
292
|
+
url = mecord_upload.upload(localFilePath,
|
|
293
|
+
None,
|
|
294
|
+
"sg",
|
|
295
|
+
needTranscode=needTranscode,
|
|
296
|
+
needAddtionUrl=True) #mecord会使用签名信息,强制needAddtionUrl
|
|
293
297
|
return _changeDomain(url, "m.mecordai.com")
|
|
294
298
|
except:
|
|
295
299
|
pass
|
|
@@ -155,7 +155,7 @@ def extend():
|
|
|
155
155
|
_genExtend()
|
|
156
156
|
elif read_data["extend"].get("device_id", "") != read_data.get("deviceInfo", {}).get("device_id", ""):
|
|
157
157
|
_genExtend()
|
|
158
|
-
elif read_data["extend"].get("app", "") == "ryry-cli
|
|
158
|
+
elif read_data["extend"].get("app", "") == "ryry-cli 5.0":
|
|
159
159
|
_genExtend()
|
|
160
160
|
else:
|
|
161
161
|
_genExtend()
|
|
@@ -73,7 +73,11 @@ def upload(src, taskUUID=None, needTranscode=False, keepItAlways=False, addition
|
|
|
73
73
|
newSrc = src
|
|
74
74
|
|
|
75
75
|
# 根据targetDomain判断使用不同的上传逻辑
|
|
76
|
-
ossurl = uploadByDomain(newSrc, targetDomain, taskUUID,
|
|
76
|
+
ossurl = uploadByDomain(newSrc, targetDomain, taskUUID,
|
|
77
|
+
keepItAlways=keepItAlways,
|
|
78
|
+
uploadPath=uploadPath,
|
|
79
|
+
needTranscode=needTranscode,
|
|
80
|
+
additionalUrl=additionalUrl)
|
|
77
81
|
|
|
78
82
|
if additionalUrl:
|
|
79
83
|
ossurl = additionalUrl(newSrc, ossurl)
|
|
@@ -81,7 +85,7 @@ def upload(src, taskUUID=None, needTranscode=False, keepItAlways=False, addition
|
|
|
81
85
|
os.remove(newSrc)
|
|
82
86
|
return ossurl
|
|
83
87
|
|
|
84
|
-
def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=None):
|
|
88
|
+
def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=None, needTranscode=False, additionalUrl=False):
|
|
85
89
|
import os
|
|
86
90
|
from pathlib import Path
|
|
87
91
|
import uuid
|
|
@@ -95,7 +99,9 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=N
|
|
|
95
99
|
upload_path = uploadPath
|
|
96
100
|
if isMecordConfig(parsed_domain):
|
|
97
101
|
from mecord import upload as mecord_upload
|
|
98
|
-
return mecord_upload.upload(src, taskUUID
|
|
102
|
+
return mecord_upload.upload(src, taskUUID,
|
|
103
|
+
needTranscode=needTranscode,
|
|
104
|
+
needAddtionUrl=True) #mecord会使用签名信息,强制needAddtionUrl
|
|
99
105
|
|
|
100
106
|
oss_config = getOssConfig(parsed_domain)
|
|
101
107
|
if oss_config:
|
|
@@ -108,18 +114,21 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=N
|
|
|
108
114
|
|
|
109
115
|
if upload_path:
|
|
110
116
|
if "mnt/NAS/mcn" in upload_path or "aigc_output/" in upload_path:
|
|
111
|
-
ftp_config = getFtpConfig("
|
|
117
|
+
ftp_config = getFtpConfig("219.136.123.179")
|
|
112
118
|
return ftpUpload(src, file_name, ftp_config, upload_path)
|
|
113
119
|
elif (targetDomain != None and"aigc_output/" in targetDomain):
|
|
114
|
-
ftp_config = getFtpConfig("
|
|
120
|
+
ftp_config = getFtpConfig("219.136.123.179")
|
|
115
121
|
return ftpUpload(src, file_name, ftp_config, upload_path)
|
|
116
122
|
elif (targetDomain == None or len(targetDomain) <= 0) and (uploadPath and len(uploadPath) > 0):
|
|
117
123
|
#找不到domain,但是有uploadPath的情况下,默认走ftp
|
|
118
|
-
ftp_config = getFtpConfig("
|
|
124
|
+
ftp_config = getFtpConfig("219.136.123.179")
|
|
119
125
|
return ftpUpload(src, file_name, ftp_config, upload_path)
|
|
120
126
|
|
|
121
127
|
from ryry import ryry_webapi
|
|
122
|
-
return ryry_webapi.upload(src, ext,
|
|
128
|
+
return ryry_webapi.upload(src, ext,
|
|
129
|
+
keepItAlways=keepItAlways,
|
|
130
|
+
needTranscode=needTranscode,
|
|
131
|
+
additionalUrl=additionalUrl)
|
|
123
132
|
|
|
124
133
|
def parseDomainAndPath(targetDomain):
|
|
125
134
|
from urllib.parse import urlparse
|
|
@@ -206,6 +215,22 @@ def ftpUpload(file, new_file_name, subdomain, upload_path=""):
|
|
|
206
215
|
import ftplib
|
|
207
216
|
while retry < 3:
|
|
208
217
|
try:
|
|
218
|
+
#如果ip是外网ip,并且在FTP_REPLACEMENT内有,则先替换成内网ip上传一次
|
|
219
|
+
if retry == 0 and "192.168" not in ip and ip in FTP_REPLACEMENT:
|
|
220
|
+
try:
|
|
221
|
+
local_network_config = DOMAIN_CONFIG[FTP_REPLACEMENT[ip]]["config"]
|
|
222
|
+
ftp = ftplib.FTP()
|
|
223
|
+
ftp.connect(local_network_config["host"], local_network_config["port"], timeout=5)
|
|
224
|
+
ftp.login(local_network_config["username"], local_network_config["password"])
|
|
225
|
+
if upload_path:
|
|
226
|
+
s = deepFtpUpload(file, new_file_name, ftp, upload_path, readpath)
|
|
227
|
+
else:
|
|
228
|
+
s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
|
|
229
|
+
ftp.quit()
|
|
230
|
+
return s
|
|
231
|
+
except:
|
|
232
|
+
pass
|
|
233
|
+
|
|
209
234
|
if retry > 0:
|
|
210
235
|
has_bak = FTP_REPLACEMENT.get(ip, None)
|
|
211
236
|
if has_bak:
|
|
@@ -270,15 +295,15 @@ ftp_192_168_50_12={
|
|
|
270
295
|
"username" : "mcn",
|
|
271
296
|
"password" : "meco@2024+",
|
|
272
297
|
"writepath" : "cache",
|
|
273
|
-
"readpath" : "ftp://
|
|
298
|
+
"readpath" : "ftp://219.136.123.179/mnt/NAS/mcn"
|
|
274
299
|
}
|
|
275
300
|
ftp_183_6_90_205={
|
|
276
|
-
"host" : "
|
|
301
|
+
"host" : "219.136.123.179",
|
|
277
302
|
"port": 2221,
|
|
278
303
|
"username" : "mcn",
|
|
279
304
|
"password" : "meco@2024+",
|
|
280
305
|
"writepath" : "cache",
|
|
281
|
-
"readpath" : "ftp://
|
|
306
|
+
"readpath" : "ftp://219.136.123.179/mnt/NAS/mcn"
|
|
282
307
|
}
|
|
283
308
|
|
|
284
309
|
from ryry import utils
|
|
@@ -320,9 +345,9 @@ def get_domain_config(target_domain):
|
|
|
320
345
|
|
|
321
346
|
DOMAIN_CONFIG = {
|
|
322
347
|
"192.168.50.12": {"type": "ftp", "config": ftp_192_168_50_12},
|
|
323
|
-
"
|
|
348
|
+
"219.136.123.179": {"type": "ftp", "config": ftp_183_6_90_205},
|
|
324
349
|
"ftp://192.168.50.12/mnt/NAS/mcn/cache": {"type": "ftp", "config": ftp_192_168_50_12},
|
|
325
|
-
"ftp://
|
|
350
|
+
"ftp://219.136.123.179/mnt/NAS/mcn/cache": {"type": "ftp", "config": ftp_183_6_90_205},
|
|
326
351
|
"res.zjtemplate.com": {"type": "oss", "config": oss_res_config},
|
|
327
352
|
"upload.zjtemplate.com": {"type": "oss", "config": oss_upload_config},
|
|
328
353
|
"oss.zjtemplate.com": {"type": "oss", "config": oss_template_config},
|
|
@@ -331,12 +356,12 @@ DOMAIN_CONFIG = {
|
|
|
331
356
|
}
|
|
332
357
|
|
|
333
358
|
FTP_REPLACEMENT = {
|
|
334
|
-
"192.168.50.12": "
|
|
335
|
-
"
|
|
359
|
+
"192.168.50.12": "219.136.123.179",
|
|
360
|
+
"219.136.123.179": "192.168.50.12",
|
|
336
361
|
}
|
|
337
362
|
|
|
338
363
|
SUBDOMAIN = {
|
|
339
|
-
"
|
|
364
|
+
"219.136.123.179": [
|
|
340
365
|
ftp_192_168_50_12,
|
|
341
366
|
ftp_183_6_90_205,
|
|
342
367
|
],
|
|
@@ -662,3 +687,5 @@ def downloadDir(url, saveDir, useCount=-1, autoDelete=False):
|
|
|
662
687
|
except Exception as e:
|
|
663
688
|
print(f"downloadDir fail: {e}")
|
|
664
689
|
return None
|
|
690
|
+
|
|
691
|
+
print(upload("/Users/pengjun/Downloads/grok_report.mp4", uploadPath="/mnt/NAS/mcn/cache"))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ryry-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0
|
|
4
4
|
Summary: ryry tools
|
|
5
5
|
Home-page: https://github.com/dalipenMedia
|
|
6
6
|
Author: dalipen
|
|
@@ -25,7 +25,7 @@ Requires-Dist: urllib3
|
|
|
25
25
|
Requires-Dist: portalocker
|
|
26
26
|
Requires-Dist: PyYAML
|
|
27
27
|
Provides-Extra: with-mecord
|
|
28
|
-
Requires-Dist: mecord-cli>=0.7.
|
|
28
|
+
Requires-Dist: mecord-cli>=0.7.407; extra == "with-mecord"
|
|
29
29
|
|
|
30
30
|
ryry Python Tool
|
|
31
31
|
===============================================
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import datetime
|
|
5
5
|
|
|
6
|
-
ryry_version = "
|
|
6
|
+
ryry_version = "5.0"
|
|
7
7
|
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
|
8
8
|
constanspy = os.path.join(cur_dir, "ryry", "constant.py")
|
|
9
9
|
try:
|
|
@@ -73,7 +73,7 @@ setuptools.setup(
|
|
|
73
73
|
'PyYAML'
|
|
74
74
|
],
|
|
75
75
|
extras_require={
|
|
76
|
-
'with_mecord': ['mecord-cli>=0.7.
|
|
76
|
+
'with_mecord': ['mecord-cli>=0.7.407'],
|
|
77
77
|
},
|
|
78
78
|
dependency_links=[],
|
|
79
79
|
entry_points={
|
|
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
|
|
File without changes
|