From fdab0a0836ff1afe544dda294e9c534670652de1 Mon Sep 17 00:00:00 2001 From: JC Francois Date: Sat, 4 Jan 2020 11:39:53 +0100 Subject: [PATCH] Add tolerance for TooManyRedirects in media search in linked page --- twoot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index e5e1d26..6b6aaf6 100755 --- a/twoot.py +++ b/twoot.py @@ -227,7 +227,10 @@ def main(argv): if match is not None: url = match.group(1).replace('&', '&') # Remove HTML-safe encoding from URL if any photos.append(url) - except (requests.exceptions.ConnectionError, requests.exceptions.Timeout, requests.exceptions.ContentDecodingError): + except (requests.exceptions.ConnectionError, + requests.exceptions.Timeout, + requests.exceptions.ContentDecodingError, + requests.exceptions.TooManyRedirects): pass # Add dictionary with content of tweet to list