change config-path for 'retries' and 'timeout'

pull/13/head
Mike Fährmann 8 years ago
parent 6fd9e66223
commit e2b5cd9918
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -4,6 +4,14 @@
{ {
"file": "/tmp/.gallery-dl.cache" "file": "/tmp/.gallery-dl.cache"
}, },
"downloader":
{
"http":
{
"retries": 5,
"timeout": null
}
},
"extractor": "extractor":
{ {
"pixiv": "pixiv":

@ -28,5 +28,5 @@ class BasicDownloader():
except (OSError, AttributeError): except (OSError, AttributeError):
pass pass
def download_impl(self, url, file_handle): def download_impl(self, url, pathfmt):
"""Actual implementaion of the download process""" """Actual implementaion of the download process"""

@ -18,12 +18,13 @@ from .. import config
class Downloader(BasicDownloader): class Downloader(BasicDownloader):
max_tries = config.interpolate(("downloader", "http", "retries",), 5)
timeout = config.interpolate(("downloader", "http", "timeout",), None)
def __init__(self, output): def __init__(self, output):
BasicDownloader.__init__(self) BasicDownloader.__init__(self)
self.session = requests.session() self.session = requests.session()
self.out = output self.out = output
self.max_tries = config.get(("retries",), 5)
self.timeout = config.get(("timeout",), None)
def download_impl(self, url, pathfmt): def download_impl(self, url, pathfmt):
tries = 0 tries = 0

Loading…
Cancel
Save