Redgif updates

Coverage for direct links.

The direct link won't work because it will have the wrong auth anyway but this will at least end up with the right API call.
This commit is contained in:
Soulsuck24 committed 2022-12-26 20:25:20 -05:00
1 parent 7cd1a70f59
commit 13887ca7e1
2 files changed
+5 -1

No files matched your search

+3 -1
View File
@@ -27,7 +27,9 @@ class Redgifs(BaseDownloader):
try:
if url.endswith("/"):
url = url.removesuffix("/")
redgif_id = re.match(r".*/(.*?)(?:\?.*|\..{0,})?$", url).group(1)
redgif_id = re.match(r".*/(.*?)(?:\?.*|\..{0,})?$", url).group(1).lower()
if redgif_id.endswith("-mobile"):
redgif_id = redgif_id.removesuffix("-mobile")
except AttributeError:
raise SiteDownloaderError(f"Could not extract Redgifs ID from {url}")
return redgif_id