mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[core] Add timeout and dumb exception handler to manifest download
This commit is contained in:
parent
87b01b77d8
commit
00f025dcc9
|
@ -1229,7 +1229,13 @@ class LegendaryCore:
|
||||||
|
|
||||||
for url in manifest_urls:
|
for url in manifest_urls:
|
||||||
self.log.debug(f'Trying to download manifest from "{url}"...')
|
self.log.debug(f'Trying to download manifest from "{url}"...')
|
||||||
r = self.egs.unauth_session.get(url)
|
try:
|
||||||
|
r = self.egs.unauth_session.get(url, timeout=10.0)
|
||||||
|
except Exception as e:
|
||||||
|
self.log.warning(f'Unable to download manifest from "{urlparse(url).netloc}" '
|
||||||
|
f'(Exception: {e!r}), trying next URL...')
|
||||||
|
continue
|
||||||
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
manifest_bytes = r.content
|
manifest_bytes = r.content
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue