mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-05-01 00:53:35 +00:00
Added tolerance for malformed URL in picture download
This commit is contained in:
parent
f635fb5eda
commit
a95006fae6
4
twoot.py
4
twoot.py
@ -409,10 +409,12 @@ def main(argv):
|
|||||||
if match is not None:
|
if match is not None:
|
||||||
url = match.group(1).replace('&', '&') # Remove HTML-safe encoding from URL if any
|
url = match.group(1).replace('&', '&') # Remove HTML-safe encoding from URL if any
|
||||||
photos.append(url)
|
photos.append(url)
|
||||||
|
# Give up if anything goes wrong
|
||||||
except (requests.exceptions.ConnectionError,
|
except (requests.exceptions.ConnectionError,
|
||||||
requests.exceptions.Timeout,
|
requests.exceptions.Timeout,
|
||||||
requests.exceptions.ContentDecodingError,
|
requests.exceptions.ContentDecodingError,
|
||||||
requests.exceptions.TooManyRedirects):
|
requests.exceptions.TooManyRedirects,
|
||||||
|
requests.exceptions.MissingSchema):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Check if video was downloaded
|
# Check if video was downloaded
|
||||||
|
Loading…
x
Reference in New Issue
Block a user