ryry-cli 4.4__tar.gz → 4.6__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.4/ryry_cli.egg-info → ryry_cli-4.6}/PKG-INFO +1 -1
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/constant.py +2 -2
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/upload.py +15 -4
- {ryry_cli-4.4 → ryry_cli-4.6/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry_cli-4.4 → ryry_cli-4.6}/setup.py +1 -1
- {ryry_cli-4.4 → ryry_cli-4.6}/LICENSE +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/README.md +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/__init__.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/daemon_base.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/daemon_manager.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/main.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/ryry_service.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/ryry_widget.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/script_template/daemon.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/script_template/main.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/script_template/run.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/server_func.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/shared_memory.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/store.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/task.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/taskUtils.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry/utils.py +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-4.4 → ryry_cli-4.6}/setup.cfg +0 -0
|
@@ -43,7 +43,7 @@ def additionalUrl(srcFile, ossUrl):
|
|
|
43
43
|
except:
|
|
44
44
|
return ossUrl
|
|
45
45
|
|
|
46
|
-
def upload(src, taskUUID=None, needTranscode=True, keepItAlways=False, additionalUrl=False):
|
|
46
|
+
def upload(src, taskUUID=None, needTranscode=True, keepItAlways=False, additionalUrl=False, uploadPath=None):
|
|
47
47
|
import os
|
|
48
48
|
from pathlib import Path
|
|
49
49
|
from ryry import taskUtils as ryry_taskUtils
|
|
@@ -56,7 +56,10 @@ def upload(src, taskUUID=None, needTranscode=True, keepItAlways=False, additiona
|
|
|
56
56
|
targetDomain = ryry_taskUtils.taskDomainWithUUID(taskUUID)
|
|
57
57
|
if targetDomain == None or len(targetDomain) <= 0:
|
|
58
58
|
from mecord import taskUtils as mecord_taskUtils
|
|
59
|
-
|
|
59
|
+
uuid_has_country_info = mecord_taskUtils.taskCountryWithUUID(taskUUID)
|
|
60
|
+
if uuid_has_country_info:
|
|
61
|
+
#这里不区分meco还是mecord,请求meco/mecord后端接口时,根据本地状态来向不同服务器请求
|
|
62
|
+
targetDomain = "https://m.mecoai.cn/"
|
|
60
63
|
|
|
61
64
|
if needTranscode:
|
|
62
65
|
needDeleteSrc, newSrc = transcode(src)
|
|
@@ -65,7 +68,7 @@ def upload(src, taskUUID=None, needTranscode=True, keepItAlways=False, additiona
|
|
|
65
68
|
newSrc = src
|
|
66
69
|
|
|
67
70
|
# 根据targetDomain判断使用不同的上传逻辑
|
|
68
|
-
ossurl = uploadByDomain(newSrc, targetDomain, taskUUID, keepItAlways)
|
|
71
|
+
ossurl = uploadByDomain(newSrc, targetDomain, taskUUID, keepItAlways=keepItAlways, uploadPath=uploadPath)
|
|
69
72
|
|
|
70
73
|
if additionalUrl:
|
|
71
74
|
ossurl = additionalUrl(newSrc, ossurl)
|
|
@@ -73,7 +76,7 @@ def upload(src, taskUUID=None, needTranscode=True, keepItAlways=False, additiona
|
|
|
73
76
|
os.remove(newSrc)
|
|
74
77
|
return ossurl
|
|
75
78
|
|
|
76
|
-
def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False):
|
|
79
|
+
def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=None):
|
|
77
80
|
import os
|
|
78
81
|
from pathlib import Path
|
|
79
82
|
import uuid
|
|
@@ -84,6 +87,8 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False):
|
|
|
84
87
|
new_file_name = ''.join(str(uuid.uuid4()).split('-'))
|
|
85
88
|
|
|
86
89
|
parsed_domain, upload_path = parseDomainAndPath(targetDomain)
|
|
90
|
+
if uploadPath:
|
|
91
|
+
upload_path = uploadPath
|
|
87
92
|
if isMecordConfig(parsed_domain):
|
|
88
93
|
from mecord import upload as mecord_upload
|
|
89
94
|
return mecord_upload.upload(src, taskUUID)
|
|
@@ -96,6 +101,10 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False):
|
|
|
96
101
|
if ftp_config:
|
|
97
102
|
return ftpUpload(src, f"{new_file_name}.{ext}", ftp_config, upload_path)
|
|
98
103
|
|
|
104
|
+
if "mnt/NAS/mcn" in upload_path:
|
|
105
|
+
ftp_config = getFtpConfig("183.6.90.205")
|
|
106
|
+
return ftpUpload(src, f"{new_file_name}.{ext}", ftp_config, upload_path)
|
|
107
|
+
|
|
99
108
|
from ryry import ryry_webapi
|
|
100
109
|
return ryry_webapi.upload(src, ext, keepItAlways)
|
|
101
110
|
|
|
@@ -187,6 +196,8 @@ def ftpUpload(file, new_file_name, subdomain, upload_path=""):
|
|
|
187
196
|
ftp.login(username, password)
|
|
188
197
|
|
|
189
198
|
if upload_path:
|
|
199
|
+
if upload_path[0:1] == "/":
|
|
200
|
+
upload_path = upload_path[1:]
|
|
190
201
|
s = deepFtpUpload(file, new_file_name, ftp, upload_path, f'ftp://{ip}/{upload_path}')
|
|
191
202
|
else:
|
|
192
203
|
s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|