Mbonea commited on
Commit
3765e28
1 Parent(s): 7e4aa66

aria2 instead of wget

Browse files
Files changed (2) hide show
  1. App/Worker.py +2 -1
  2. Dockerfile +1 -1
App/Worker.py CHANGED
@@ -28,7 +28,7 @@ def worker_process_init_handler(**kwargs):
28
 
29
 
30
  def download_with_wget(link, download_dir, filename):
31
- subprocess.run(["wget", "-P", download_dir, "-O", filename, link])
32
 
33
 
34
  @celery.task
@@ -57,6 +57,7 @@ def download_assets(links: List[str], temp_dir: str):
57
  # If Content-Disposition is not available, use the last part of the URL as the filename
58
  filename = os.path.basename(urlparse(link).path)
59
  public_dir = f"{temp_dir}/public"
 
60
  # Use the extracted filename to save the file
61
 
62
  download_with_wget(link, public_dir, filename)
 
28
 
29
 
30
  def download_with_wget(link, download_dir, filename):
31
+ subprocess.run(["aria2c", link, "-d", download_dir, "-o", filename])
32
 
33
 
34
  @celery.task
 
57
  # If Content-Disposition is not available, use the last part of the URL as the filename
58
  filename = os.path.basename(urlparse(link).path)
59
  public_dir = f"{temp_dir}/public"
60
+ print(public_dir)
61
  # Use the extracted filename to save the file
62
 
63
  download_with_wget(link, public_dir, filename)
Dockerfile CHANGED
@@ -9,7 +9,7 @@ RUN chmod -R 755 /srv
9
 
10
  # Install dependencies
11
  RUN apt-get update && \
12
- apt-get install -y libu2f-udev libvulkan1 mesa-vulkan-drivers wget ffmpeg curl
13
 
14
  RUN apt-get install -y \
15
  fonts-liberation \
 
9
 
10
  # Install dependencies
11
  RUN apt-get update && \
12
+ apt-get install -y libu2f-udev libvulkan1 mesa-vulkan-drivers wget ffmpeg curl aria2
13
 
14
  RUN apt-get install -y \
15
  fonts-liberation \