mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-19 18:31:24 +02:00
fix timeout
This commit is contained in:
parent
e306d50b7e
commit
42a09e2c1e
@ -1,3 +1,3 @@
|
||||
__version__ = '0.2.4'
|
||||
__version__ = '0.2.5'
|
||||
__author__ = 'Ricter'
|
||||
__email__ = 'ricterzheng@gmail.com'
|
||||
|
@ -44,7 +44,7 @@ class Downloader(Singleton):
|
||||
for chunk in response.iter_content(2048):
|
||||
f.write(chunk)
|
||||
|
||||
except requests.HTTPError as e:
|
||||
except (requests.HTTPError, requests.Timeout) as e:
|
||||
if retried < 3:
|
||||
logger.warning('Warning: {0}, retrying({1}) ...'.format(str(e), retried))
|
||||
return 0, self._download(url=url, folder=folder, filename=filename, retried=retried+1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user