change config-path for 'retries' and 'timeout'
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user