Add tolerance for TooManyRedirects in media search in linked page

This commit is contained in:
JC Francois 2020-01-04 11:39:53 +01:00
parent bb226e54a9
commit fdab0a0836

View File

@ -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