From a95006fae65788a9e8116cbbfee208b31d5aa84a Mon Sep 17 00:00:00 2001 From: JC Francois Date: Thu, 9 Apr 2020 18:17:13 +0200 Subject: [PATCH] Added tolerance for malformed URL in picture download --- twoot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index 0c65369..f0faed2 100755 --- a/twoot.py +++ b/twoot.py @@ -409,10 +409,12 @@ def main(argv): if match is not None: url = match.group(1).replace('&', '&') # Remove HTML-safe encoding from URL if any photos.append(url) + # Give up if anything goes wrong except (requests.exceptions.ConnectionError, requests.exceptions.Timeout, requests.exceptions.ContentDecodingError, - requests.exceptions.TooManyRedirects): + requests.exceptions.TooManyRedirects, + requests.exceptions.MissingSchema): pass # Check if video was downloaded