diff --git a/devine/core/downloaders/__init__.py b/devine/core/downloaders/__init__.py index 60de9c2..8e20291 100644 --- a/devine/core/downloaders/__init__.py +++ b/devine/core/downloaders/__init__.py @@ -1,6 +1,15 @@ +import asyncio + from .aria2c import aria2c from .requests import requests from .saldl import saldl -from .downloader import downloader +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)) +}[config.downloader] + __ALL__ = (downloader, aria2c, requests, saldl) diff --git a/devine/core/downloaders/downloader.py b/devine/core/downloaders/downloader.py deleted file mode 100644 index 9011d52..0000000 --- a/devine/core/downloaders/downloader.py +++ /dev/null @@ -1,12 +0,0 @@ -import asyncio -from functools import partial - -from devine.core.config import config -from devine.core.downloaders import aria2c, requests, saldl - - -downloader = { - "aria2c": partial(asyncio.run, aria2c), - "requests": requests, - "saldl": partial(asyncio.run, saldl) -}[config.downloader]