Catch additional errors in site downloaders

This commit is contained in:
Serene-Arc
2021-04-28 15:17:21 +10:00
committed by Serene
parent 6a20548269
commit 7fcbf623a0
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ class Redgifs(GifDeliveryNetwork):
try:
out = json.loads(content.contents[0])['video']['contentUrl']
except (IndexError, KeyError):
except (IndexError, KeyError, AttributeError):
raise SiteDownloaderError('Failed to find JSON data in page')
except json.JSONDecodeError as e:
raise SiteDownloaderError(f'Received data was not valid JSON: {e}')