Merge pull request #748 from Soulsuck24/development
This commit is contained in:
commit
e96b167b71
|
@ -28,7 +28,7 @@ class DownloadFactory:
|
||||||
sanitised_url = DownloadFactory.sanitise_url(url)
|
sanitised_url = DownloadFactory.sanitise_url(url)
|
||||||
if re.match(r"(i\.|m\.)?imgur", sanitised_url):
|
if re.match(r"(i\.|m\.)?imgur", sanitised_url):
|
||||||
return Imgur
|
return Imgur
|
||||||
elif re.match(r"(i\.|thumbs\d\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
|
elif re.match(r"(i\.|thumbs\d\.|v\d\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
|
||||||
return Redgifs
|
return Redgifs
|
||||||
elif re.match(r".*/.*\.[a-zA-Z34]{3,4}(\?[\w;&=]*)?$", sanitised_url) and not DownloadFactory.is_web_resource(
|
elif re.match(r".*/.*\.[a-zA-Z34]{3,4}(\?[\w;&=]*)?$", sanitised_url) and not DownloadFactory.is_web_resource(
|
||||||
sanitised_url
|
sanitised_url
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Redgifs(BaseDownloader):
|
||||||
try:
|
try:
|
||||||
if url.endswith("/"):
|
if url.endswith("/"):
|
||||||
url = url.removesuffix("/")
|
url = url.removesuffix("/")
|
||||||
redgif_id = re.match(r".*/(.*?)(?:\?.*|\..{0,})?$", url).group(1).lower()
|
redgif_id = re.match(r".*/(.*?)(?:#.*|\?.*|\..{0,})?$", url).group(1).lower()
|
||||||
if redgif_id.endswith("-mobile"):
|
if redgif_id.endswith("-mobile"):
|
||||||
redgif_id = redgif_id.removesuffix("-mobile")
|
redgif_id = redgif_id.removesuffix("-mobile")
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
|
@ -41,6 +41,7 @@ from bdfr.site_downloaders.youtube import Youtube
|
||||||
("https://redgifs.com/watch/courageousimpeccablecanvasback", Redgifs),
|
("https://redgifs.com/watch/courageousimpeccablecanvasback", Redgifs),
|
||||||
("https://www.gifdeliverynetwork.com/repulsivefinishedandalusianhorse", Redgifs),
|
("https://www.gifdeliverynetwork.com/repulsivefinishedandalusianhorse", Redgifs),
|
||||||
("https://thumbs4.redgifs.com/DismalIgnorantDrongo-mobile.mp4", Redgifs),
|
("https://thumbs4.redgifs.com/DismalIgnorantDrongo-mobile.mp4", Redgifs),
|
||||||
|
("https://v3.redgifs.com/watch/kaleidoscopicdaringvenomoussnake", Redgifs),
|
||||||
("https://youtu.be/DevfjHOhuFc", Youtube),
|
("https://youtu.be/DevfjHOhuFc", Youtube),
|
||||||
("https://m.youtube.com/watch?v=kr-FeojxzUM", Youtube),
|
("https://m.youtube.com/watch?v=kr-FeojxzUM", Youtube),
|
||||||
("https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781", Direct),
|
("https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781", Direct),
|
||||||
|
|
|
@ -18,6 +18,7 @@ from bdfr.site_downloaders.redgifs import Redgifs
|
||||||
("https://www.redgifs.com/watch/marriedcrushingcob?rel=u%3Akokiri.girl%3Bo%3Arecent", "marriedcrushingcob"),
|
("https://www.redgifs.com/watch/marriedcrushingcob?rel=u%3Akokiri.girl%3Bo%3Arecent", "marriedcrushingcob"),
|
||||||
("https://thumbs4.redgifs.com/DismalIgnorantDrongo.mp4", "dismalignorantdrongo"),
|
("https://thumbs4.redgifs.com/DismalIgnorantDrongo.mp4", "dismalignorantdrongo"),
|
||||||
("https://thumbs4.redgifs.com/DismalIgnorantDrongo-mobile.mp4", "dismalignorantdrongo"),
|
("https://thumbs4.redgifs.com/DismalIgnorantDrongo-mobile.mp4", "dismalignorantdrongo"),
|
||||||
|
("https://v3.redgifs.com/watch/newilliteratemeerkat#rel=user%3Atastynova", "newilliteratemeerkat"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def test_get_id(test_url: str, expected: str):
|
def test_get_id(test_url: str, expected: str):
|
||||||
|
|
Loading…
Reference in a new issue