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.
Files changed (28) hide show
  1. {ryry_cli-2.31 → ryry_cli-2.33}/PKG-INFO +1 -1
  2. ryry_cli-2.33/ryry/constant.py +5 -0
  3. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_server_socket.py +0 -1
  4. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/task.py +3 -1
  5. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/upload.py +8 -45
  6. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/PKG-INFO +1 -1
  7. {ryry_cli-2.31 → ryry_cli-2.33}/setup.py +1 -1
  8. ryry_cli-2.31/ryry/constant.py +0 -5
  9. {ryry_cli-2.31 → ryry_cli-2.33}/LICENSE +0 -0
  10. {ryry_cli-2.31 → ryry_cli-2.33}/README.md +0 -0
  11. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/__init__.py +0 -0
  12. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/main.py +0 -0
  13. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_service.py +0 -0
  14. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_webapi.py +0 -0
  15. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/ryry_widget.py +0 -0
  16. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/__init__.py +0 -0
  17. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/main.py +0 -0
  18. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/script_template/run.py +0 -0
  19. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/server_func.py +0 -0
  20. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/store.py +0 -0
  21. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/taskUtils.py +0 -0
  22. {ryry_cli-2.31 → ryry_cli-2.33}/ryry/utils.py +0 -0
  23. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/SOURCES.txt +0 -0
  24. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/dependency_links.txt +0 -0
  25. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/entry_points.txt +0 -0
  26. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/requires.txt +0 -0
  27. {ryry_cli-2.31 → ryry_cli-2.33}/ryry_cli.egg-info/top_level.txt +0 -0
  28. {ryry_cli-2.31 → ryry_cli-2.33}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.31
3
+ Version: 2.33
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -0,0 +1,5 @@
1
+ #!!!!! do not change this file !!!!!
2
+ app_version="2.33"
3
+ app_bulld_number=233
4
+ app_bulld_anchor="Noh_2024-08-15 15:07:33.090092"
5
+ app_name="ryry-cli"
@@ -56,7 +56,6 @@ class RyryTaskExecutor(Thread):
56
56
  if data is None:
57
57
  break
58
58
  try:
59
- print(f"======= get data = {data}")
60
59
  taskUUID = data["taskUUID"]
61
60
  domain = ""
62
61
  params_tmp = json.loads(data["data"])
@@ -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 _can_connect_ftp(ip, SUBDOMAIN[ip]["username"], SUBDOMAIN[ip]["password"], SUBDOMAIN[ip]["writepath"]) and targetDomain == SUBDOMAIN[ip]["readpath"]:
183
- return SUBDOMAIN[ip]
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:]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.31
3
+ Version: 2.33
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -3,7 +3,7 @@ import os
3
3
  import subprocess
4
4
  import datetime
5
5
 
6
- ryry_version = "2.31"
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")
@@ -1,5 +0,0 @@
1
- #!!!!! do not change this file !!!!!
2
- app_version="2.31"
3
- app_bulld_number=231
4
- app_bulld_anchor="Noh_2024-08-14 19:48:56.982357"
5
- app_name="ryry-cli"
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