Skip to content

Instantly share code, notes, and snippets.

@mhrivnak
Created March 27, 2013 18:54
Show Gist options
  • Save mhrivnak/5256997 to your computer and use it in GitHub Desktop.
Save mhrivnak/5256997 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from pulp.common.download.config import DownloaderConfig
from pulp.common.download.request import DownloadRequest
from pulp.common.download.backends.curl import HTTPCurlDownloadBackend
with open('files.txt') as f:
requests = [DownloadRequest(url, url.rsplit('/', 1)[1]) for url in f.readlines()]
config = DownloaderConfig('http', max_concurrent=7)
be = HTTPCurlDownloadBackend(config)
be.download(requests)
#!/usr/bin/env python
from pulp.common.download.config import DownloaderConfig
from pulp.common.download.request import DownloadRequest
from pulp.common.download.downloaders.event import HTTPEventletDownloader
with open('files.txt') as f:
requests = [DownloadRequest(url, url.rsplit('/', 1)[1]) for url in f.readlines()]
config = DownloaderConfig(max_concurrent=7)
be = HTTPEventletDownloader(config)
be.download(requests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment