Cadair / parfive

An asyncio based parallel file downloader for Python 3.8+

Home Page:https://parfive.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a class method for quick download

Cadair opened this issue · comments

If you have an iterable of URLs it should be easy to download all of them in one go, at the moment you have to instantiate Downloader call enqueue_file for each URL and then call download.

It would be nice to add a classmethod which looks like this:

@classmethod
def quick_download(cls, *urls, path=None, overwrite=None):
    dl = cls()
    for url in urls:
        dl.enqueue_file(url, path=path, overwrite=overwrite)
    return dl.download()

would be a quick and easy way to download a bunch of files. If you wanted more control over the kwargs then you could use the longer API.