Cadair / parfive

An asyncio based parallel file downloader for Python 3.8+
https://parfive.readthedocs.io/
MIT License
51 stars 24 forks source link

Add a class method for quick download #72

Closed Cadair closed 3 years ago

Cadair commented 3 years ago

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.