Redgifs fixed?

If this doesn't work then I give up...
This commit is contained in:
SoulSuck24
2022-09-16 20:41:17 -04:00
parent 0a9ecac410
commit 95749584ec
2 changed files with 6 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ class Redgifs(BaseDownloader):
@staticmethod
def _get_link(url: str) -> set[str]:
try:
redgif_id = re.match(r'.*/(.*?)/?$', url).group(1)
redgif_id = re.match(r'.*/(.*?)(\..{3,})?$', url).group(1)
except AttributeError:
raise SiteDownloaderError(f'Could not extract Redgifs ID from {url}')
@@ -55,4 +55,7 @@ class Redgifs(BaseDownloader):
except (KeyError, AttributeError):
raise SiteDownloaderError('Failed to find JSON data in page')
# Update subdomain if old one is returned
out = {re.sub('thumbs2', 'thumbs3', link) for link in out}
out = {re.sub('thumbs3', 'thumbs4', link) for link in out}
return out