ryry-cli 2.31__tar.gz → 2.33__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.31 → ryry_cli-2.33}/PKG-INFO +1 -1
- ryry_cli-2.33/ryry/constant.py +5 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_server_socket.py +0 -1
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/task.py +3 -1
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/upload.py +8 -45
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.31 → ryry_cli-2.33}/setup.py +1 -1
- ryry_cli-2.31/ryry/constant.py +0 -5
- {ryry_cli-2.31 → ryry_cli-2.33}/LICENSE +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/README.md +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/__init__.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/main.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_widget.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/server_func.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/store.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry/utils.py +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.31 → ryry_cli-2.33}/setup.cfg +0 -0
|
@@ -52,6 +52,8 @@ def cmdWithWidget(widget_id):
|
|
|
52
52
|
def cmdWithWidgetName(name):
|
|
53
53
|
map = store.widgetMap()
|
|
54
54
|
for widget_id in map.keys():
|
|
55
|
+
if "name" not in map[widget_id]:
|
|
56
|
+
continue
|
|
55
57
|
if map[widget_id]["name"] == name and map[widget_id]["isBlock"] == False:
|
|
56
58
|
is_block = map[widget_id]["isBlock"]
|
|
57
59
|
return map[widget_id]["path"]
|
|
@@ -142,7 +144,7 @@ def updateProgress(data, progress=50, taskUUID=None):
|
|
|
142
144
|
progress = 0
|
|
143
145
|
if progress > 100:
|
|
144
146
|
progress = 100
|
|
145
|
-
if realTaskUUID.startswith("local_") == False:
|
|
147
|
+
if realTaskUUID and realTaskUUID.startswith("local_") == False:
|
|
146
148
|
return ryry_webapi.TaskUpdateProgress(realTaskUUID, progress, json.dumps(data))
|
|
147
149
|
|
|
148
150
|
def timeout_killprocess(proc, timeout): # """超过指定的秒数后杀死进程"""
|
|
@@ -1,42 +1,5 @@
|
|
|
1
1
|
from urllib.parse import *
|
|
2
2
|
|
|
3
|
-
def addtionExif(srcFile, taskUUID):
|
|
4
|
-
if taskUUID == None or len(taskUUID) == 0:
|
|
5
|
-
return
|
|
6
|
-
try:
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
file_name = Path(srcFile).name
|
|
9
|
-
ext = file_name[file_name.index("."):].lower()
|
|
10
|
-
if ext in [".jpg", ".png", ".jpeg", ".bmp", ".webp", ".gif"]:
|
|
11
|
-
from PIL import Image
|
|
12
|
-
img = Image.open(srcFile)
|
|
13
|
-
exif_dict = {
|
|
14
|
-
"0th": { },
|
|
15
|
-
"Exif": { },
|
|
16
|
-
"1st": { },
|
|
17
|
-
"thumbnail": None,
|
|
18
|
-
"GPS": { }
|
|
19
|
-
}
|
|
20
|
-
import piexif
|
|
21
|
-
if taskUUID:
|
|
22
|
-
exif_dict["0th"] = {
|
|
23
|
-
piexif.ImageIFD.Software: f'make with ryry({taskUUID})'.encode(),
|
|
24
|
-
piexif.ImageIFD.Copyright: f'dalipen'.encode(),
|
|
25
|
-
}
|
|
26
|
-
exif_dict["Exif"] = {
|
|
27
|
-
piexif.ExifIFD.UserComment: f'make with ryry({taskUUID})'.encode(),
|
|
28
|
-
}
|
|
29
|
-
exif_dat = piexif.dump(exif_dict)
|
|
30
|
-
img.save(srcFile, "webp", quality=90, exif=exif_dat)
|
|
31
|
-
# elif ext in [".mp4",".mov",".avi",".wmv",".mpg",".mpeg",".rm",".ram",".flv",".swf",".ts"]:
|
|
32
|
-
# params = {}
|
|
33
|
-
# elif ext in [".mp3",".aac",".wav",".wma",".cda",".flac",".m4a",".mid",".mka",".mp2",".mpa",".mpc",".ape",".ofr",".ogg",".ra",".wv",".tta",".ac3",".dts"]:
|
|
34
|
-
# params = {}
|
|
35
|
-
# else:
|
|
36
|
-
# params = {}
|
|
37
|
-
except:
|
|
38
|
-
return
|
|
39
|
-
|
|
40
3
|
def transcode(srcFile):
|
|
41
4
|
try:
|
|
42
5
|
from pathlib import Path
|
|
@@ -80,13 +43,13 @@ def additionalUrl(srcFile, ossUrl):
|
|
|
80
43
|
except:
|
|
81
44
|
return ossUrl
|
|
82
45
|
|
|
83
|
-
def upload(src, taskUUID, timeout=300, needTranscode=True):
|
|
46
|
+
def upload(src, taskUUID=None, timeout=300, needTranscode=True):
|
|
84
47
|
import os
|
|
85
48
|
from pathlib import Path
|
|
86
49
|
from ryry import taskUtils
|
|
87
50
|
if os.path.exists(src) == False:
|
|
88
51
|
raise Exception(f"upload file not found")
|
|
89
|
-
if taskUUID==None or len(taskUUID) <= 0:
|
|
52
|
+
if taskUUID == None or len(taskUUID) <= 0:
|
|
90
53
|
taskUUID = taskUtils.taskInfoWithFirstTask()
|
|
91
54
|
targetDomain = taskUtils.taskDomainWithUUID(taskUUID)
|
|
92
55
|
|
|
@@ -95,7 +58,6 @@ def upload(src, taskUUID, timeout=300, needTranscode=True):
|
|
|
95
58
|
else:
|
|
96
59
|
needDeleteSrc = False
|
|
97
60
|
newSrc = src
|
|
98
|
-
addtionExif(newSrc, taskUUID)
|
|
99
61
|
support_subdomain = getSubdomain(targetDomain)
|
|
100
62
|
if support_subdomain:
|
|
101
63
|
import uuid
|
|
@@ -133,7 +95,7 @@ def ftpUpload(file, new_file_name, subdomain):
|
|
|
133
95
|
writepath = subdomain["writepath"]
|
|
134
96
|
readpath = subdomain["readpath"]
|
|
135
97
|
import ftplib
|
|
136
|
-
ftp = ftplib.FTP(ip)
|
|
98
|
+
ftp = ftplib.FTP(ip, timeout=3)
|
|
137
99
|
ftp.login(username, password)
|
|
138
100
|
|
|
139
101
|
s = deepFtpUpload(file, new_file_name, ftp, writepath, readpath)
|
|
@@ -143,7 +105,7 @@ def ftpUpload(file, new_file_name, subdomain):
|
|
|
143
105
|
def _can_connect_ftp(ip, username, password, writepath):
|
|
144
106
|
import ftplib
|
|
145
107
|
try:
|
|
146
|
-
ftp = ftplib.FTP(ip)
|
|
108
|
+
ftp = ftplib.FTP(ip, timeout=3)
|
|
147
109
|
ftp.login(username, password)
|
|
148
110
|
try:
|
|
149
111
|
ftp.cwd(writepath)
|
|
@@ -179,8 +141,9 @@ def getSubdomain(targetDomain):
|
|
|
179
141
|
if len(targetDomain) <= 0:
|
|
180
142
|
return None
|
|
181
143
|
for ip in SUBDOMAIN.keys():
|
|
182
|
-
if
|
|
183
|
-
|
|
144
|
+
if targetDomain == SUBDOMAIN[ip]["readpath"]:
|
|
145
|
+
if _can_connect_ftp(ip, SUBDOMAIN[ip]["username"], SUBDOMAIN[ip]["password"], SUBDOMAIN[ip]["writepath"]):
|
|
146
|
+
return SUBDOMAIN[ip]
|
|
184
147
|
return None
|
|
185
148
|
|
|
186
149
|
def getFirstSupportSubdomain():
|
|
@@ -210,7 +173,7 @@ def download(url, saveDir):
|
|
|
210
173
|
password = SUBDOMAIN[host]["password"]
|
|
211
174
|
writepath = SUBDOMAIN[host]["writepath"]
|
|
212
175
|
readpath = SUBDOMAIN[host]["readpath"]
|
|
213
|
-
ftp = ftplib.FTP(ip)
|
|
176
|
+
ftp = ftplib.FTP(ip, timeout=3)
|
|
214
177
|
ftp.login(username, password)
|
|
215
178
|
|
|
216
179
|
remote_filepath = parsed_url.path[1:]
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import datetime
|
|
5
5
|
|
|
6
|
-
ryry_version = "2.
|
|
6
|
+
ryry_version = "2.33"
|
|
7
7
|
ryry_build_number = int(ryry_version.replace(".",""))
|
|
8
8
|
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
|
9
9
|
constanspy = os.path.join(cur_dir, "ryry", "constant.py")
|
ryry_cli-2.31/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
|