diff --git a/devine/core/downloaders/__init__.py b/devine/core/downloaders/__init__.py index 8e20291..5c0434e 100644 --- a/devine/core/downloaders/__init__.py +++ b/devine/core/downloaders/__init__.py @@ -2,14 +2,12 @@ import asyncio from .aria2c import aria2c from .requests import requests -from .saldl import saldl from ..config import config downloader = { "aria2c": lambda *args, **kwargs: asyncio.run(aria2c(*args, **kwargs)), - "requests": requests, - "saldl": lambda *args, **kwargs: asyncio.run(saldl(*args, **kwargs)) + "requests": requests }[config.downloader] -__ALL__ = (downloader, aria2c, requests, saldl) +__ALL__ = (downloader, aria2c, requests) diff --git a/devine/core/downloaders/saldl.py b/devine/core/downloaders/saldl.py deleted file mode 100644 index 34166d1..0000000 --- a/devine/core/downloaders/saldl.py +++ /dev/null @@ -1,51 +0,0 @@ -import subprocess -from pathlib import Path -from typing import Optional, Union - -from devine.core.utilities import get_binary_path - - -async def saldl( - uri: Union[str, list[str]], - out: Union[Path, str], - headers: Optional[dict] = None, - proxy: Optional[str] = None -) -> int: - out = Path(out) - - if headers: - headers.update({k: v for k, v in headers.items() if k.lower() != "accept-encoding"}) - - executable = get_binary_path("saldl", "saldl-win64", "saldl-win32") - if not executable: - raise EnvironmentError("Saldl executable not found...") - - arguments = [ - executable, - # "--no-status", - "--skip-TLS-verification", - "--resume", - "--merge-in-order", - "-c8", - "--auto-size", "1", - "-D", str(out.parent), - "-o", out.name - ] - - if headers: - arguments.extend([ - "--custom-headers", - "\r\n".join([f"{k}: {v}" for k, v in headers.items()]) - ]) - - if proxy: - arguments.extend(["--proxy", proxy]) - - if isinstance(uri, list): - raise ValueError("Saldl code does not yet support multiple uri (e.g. segmented) downloads.") - arguments.append(uri) - - return subprocess.check_call(arguments) - - -__ALL__ = (saldl,)