ryry-cli 2.37__tar.gz → 2.40__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.37 → ryry_cli-2.40}/PKG-INFO +2 -1
  2. ryry_cli-2.40/ryry/constant.py +5 -0
  3. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/ryry_server_socket.py +1 -1
  4. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/upload.py +21 -6
  5. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/PKG-INFO +2 -1
  6. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/requires.txt +1 -0
  7. {ryry_cli-2.37 → ryry_cli-2.40}/setup.py +2 -1
  8. ryry_cli-2.37/ryry/constant.py +0 -5
  9. {ryry_cli-2.37 → ryry_cli-2.40}/LICENSE +0 -0
  10. {ryry_cli-2.37 → ryry_cli-2.40}/README.md +0 -0
  11. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/__init__.py +0 -0
  12. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/main.py +0 -0
  13. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/ryry_service.py +0 -0
  14. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/ryry_webapi.py +0 -0
  15. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/ryry_widget.py +0 -0
  16. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/script_template/__init__.py +0 -0
  17. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/script_template/main.py +0 -0
  18. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/script_template/run.py +0 -0
  19. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/server_func.py +0 -0
  20. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/store.py +0 -0
  21. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/task.py +0 -0
  22. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/taskUtils.py +0 -0
  23. {ryry_cli-2.37 → ryry_cli-2.40}/ryry/utils.py +0 -0
  24. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/SOURCES.txt +0 -0
  25. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/dependency_links.txt +0 -0
  26. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/entry_points.txt +0 -0
  27. {ryry_cli-2.37 → ryry_cli-2.40}/ryry_cli.egg-info/top_level.txt +0 -0
  28. {ryry_cli-2.37 → ryry_cli-2.40}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.37
3
+ Version: 2.40
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -19,6 +19,7 @@ Requires-Dist: psutil
19
19
  Requires-Dist: pynvml
20
20
  Requires-Dist: requests_toolbelt
21
21
  Requires-Dist: matplotlib
22
+ Requires-Dist: fake_useragent
22
23
  Requires-Dist: ping3
23
24
  Requires-Dist: piexif
24
25
  Requires-Dist: gputil
@@ -0,0 +1,5 @@
1
+ #!!!!! do not change this file !!!!!
2
+ app_version="2.40"
3
+ app_bulld_number=240
4
+ app_bulld_anchor="Noh_2024-08-26 20:04:08.243117"
5
+ app_name="ryry-cli"
@@ -170,7 +170,7 @@ class RyryShortConnectThread(Thread):
170
170
  def run(self):
171
171
  print(f" {self.name} start")
172
172
  min_wait_time = 2
173
- max_wait_time = 10
173
+ max_wait_time = 30
174
174
  wait_time = min_wait_time
175
175
  consecutive_step = 2
176
176
  consecutive_failures = 0
@@ -160,11 +160,9 @@ def download(url, saveDir):
160
160
  return None
161
161
  try:
162
162
  name = ''.join(str(uuid.uuid4()).split('-'))
163
- ext = urlparser.urlparse(url).path[urlparser.urlparse(url).path.index("."):]
164
- savePath = os.path.join(saveDir, f"{name}{ext}")
165
163
 
166
164
  if url.startswith("ftp"):
167
- import ftplib
165
+ import ftplib, random
168
166
  parsed_url = urlparse(url)
169
167
  host = parsed_url.hostname
170
168
  if host in SUBDOMAIN:
@@ -177,8 +175,23 @@ def download(url, saveDir):
177
175
  ftp.login(username, password)
178
176
 
179
177
  remote_filepath = parsed_url.path[1:]
180
- with open(savePath, 'wb') as f:
181
- ftp.retrbinary(f'RETR {remote_filepath}', f.write)
178
+ if "." in urlparser.urlparse(url).path:
179
+ ext = urlparser.urlparse(url).path[urlparser.urlparse(url).path.index("."):]
180
+ savePath = os.path.join(saveDir, f"{name}{ext}")
181
+ with open(savePath, 'wb') as f:
182
+ ftp.retrbinary(f'RETR {remote_filepath}', f.write)
183
+ return savePath
184
+ else:
185
+ if remote_filepath[-1:] != "/":
186
+ remote_filepath += "/"
187
+ ftp.cwd(remote_filepath)
188
+ files = ftp.nlst()
189
+ if files:
190
+ random_file = random.choice(files)
191
+ savePath = os.path.join(saveDir, f"{name}_{random_file}")
192
+ with open(savePath, 'wb') as f:
193
+ ftp.retrbinary(f'RETR {random_file}', f.write)
194
+ return savePath
182
195
  ftp.quit()
183
196
  else:
184
197
  print(f"download fail: domain {host} not support")
@@ -189,6 +202,8 @@ def download(url, saveDir):
189
202
  s.headers.update({'Connection':'close'})
190
203
  ua = UserAgent()
191
204
  file = s.get(url, verify=False, headers={'User-Agent': ua.random}, timeout=30)
205
+ ext = urlparser.urlparse(url).path[urlparser.urlparse(url).path.index("."):]
206
+ savePath = os.path.join(saveDir, f"{name}{ext}")
192
207
  if os.path.exists(savePath):
193
208
  os.remove(savePath)
194
209
  with open(savePath, "wb") as c:
@@ -205,4 +220,4 @@ def download(url, saveDir):
205
220
  return None
206
221
 
207
222
  # url = upload("D:\\0505.mp4", "111", 300)
208
- # download(url, "D:\\")
223
+ # download("ftp://192.168.3.220/1TB01/data/mcn/digital_male_1", "E:\\semi-automatic_mixed_video-main\\task_system\\widget\\gen_template_video\\.temp")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ryry-cli
3
- Version: 2.37
3
+ Version: 2.40
4
4
  Summary: ryry tools
5
5
  Home-page: https://github.com/dalipenMedia
6
6
  Author: dalipen
@@ -19,6 +19,7 @@ Requires-Dist: psutil
19
19
  Requires-Dist: pynvml
20
20
  Requires-Dist: requests_toolbelt
21
21
  Requires-Dist: matplotlib
22
+ Requires-Dist: fake_useragent
22
23
  Requires-Dist: ping3
23
24
  Requires-Dist: piexif
24
25
  Requires-Dist: gputil
@@ -6,6 +6,7 @@ psutil
6
6
  pynvml
7
7
  requests_toolbelt
8
8
  matplotlib
9
+ fake_useragent
9
10
  ping3
10
11
  piexif
11
12
  gputil
@@ -3,7 +3,7 @@ import os
3
3
  import subprocess
4
4
  import datetime
5
5
 
6
- ryry_version = "2.37"
6
+ ryry_version = "2.40"
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")
@@ -57,6 +57,7 @@ setuptools.setup(
57
57
  'pynvml',
58
58
  'requests_toolbelt',
59
59
  'matplotlib',
60
+ 'fake_useragent',
60
61
  'ping3',
61
62
  'piexif',
62
63
  'gputil',
@@ -1,5 +0,0 @@
1
- #!!!!! do not change this file !!!!!
2
- app_version="2.37"
3
- app_bulld_number=237
4
- app_bulld_anchor="Noh_2024-08-23 10:43:12.640901"
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
File without changes