ryry-cli 4.29__tar.gz → 4.31__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.29/ryry_cli.egg-info → ryry_cli-4.31}/PKG-INFO +1 -1
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/constant.py +2 -2
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/ryry_webapi.py +6 -2
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/store.py +1 -1
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/upload.py +13 -4
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/utils.py +21 -2
- {ryry_cli-4.29 → ryry_cli-4.31/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry_cli-4.29 → ryry_cli-4.31}/setup.py +1 -1
- {ryry_cli-4.29 → ryry_cli-4.31}/LICENSE +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/README.md +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/__init__.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/daemon_base.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/daemon_manager.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/main.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/proxy_manager.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/ryry_service.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/ryry_widget.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/script_template/daemon.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/script_template/main.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/script_template/run.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/server_func.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/shared_memory.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/task.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry/taskUtils.py +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-4.29 → ryry_cli-4.31}/setup.cfg +0 -0
|
@@ -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 4.
|
|
158
|
+
elif read_data["extend"].get("app", "") == "ryry-cli 4.31":
|
|
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:
|
|
@@ -119,7 +125,10 @@ def uploadByDomain(src, targetDomain, taskUUID, keepItAlways=False, uploadPath=N
|
|
|
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
|
|
@@ -231,8 +231,8 @@ def begin_restart(reason, update_cli=False, simple="https://pypi.python.org/simp
|
|
|
231
231
|
"simple": simple
|
|
232
232
|
},f)
|
|
233
233
|
|
|
234
|
-
K1 = "
|
|
235
|
-
K2 = "
|
|
234
|
+
K1 = "TFRBSTV0UkR3NXhocHc1eDlVdkZaUWsy"
|
|
235
|
+
K2 = "TFVuYlRuZFRQMHpxYmU3TjVJSGw0YlVvdlJNQkR6"
|
|
236
236
|
def _decode_key(encoded_key):
|
|
237
237
|
import base64
|
|
238
238
|
try:
|
|
@@ -244,6 +244,25 @@ def _decode_key(encoded_key):
|
|
|
244
244
|
decoded_bytes = base64.b64decode(encoded_key.encode('utf-8'))
|
|
245
245
|
return decoded_bytes.hex()
|
|
246
246
|
|
|
247
|
+
def _encode_key(raw_input):
|
|
248
|
+
import base64
|
|
249
|
+
if isinstance(raw_input, bytes):
|
|
250
|
+
# 直接是字节数据,编码为 base64
|
|
251
|
+
encoded = base64.b64encode(raw_input)
|
|
252
|
+
elif isinstance(raw_input, str):
|
|
253
|
+
try:
|
|
254
|
+
# 尝试当作普通字符串
|
|
255
|
+
encoded = base64.b64encode(raw_input.encode('utf-8'))
|
|
256
|
+
except UnicodeEncodeError:
|
|
257
|
+
# 如果编码失败,尝试当作十六进制字符串
|
|
258
|
+
try:
|
|
259
|
+
encoded = base64.b64encode(bytes.fromhex(raw_input))
|
|
260
|
+
except ValueError:
|
|
261
|
+
raise ValueError("Input is not valid UTF-8 string or hex string")
|
|
262
|
+
else:
|
|
263
|
+
raise TypeError("Input must be str or bytes")
|
|
264
|
+
return encoded.decode('utf-8')
|
|
265
|
+
|
|
247
266
|
|
|
248
267
|
def check_restart():
|
|
249
268
|
restart_file = os.path.join(constant.base_path, "restart")
|
|
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
|