1
0
Fork 0
mirror of synced 2024-06-26 18:10:26 +12:00

Merge pull request #716 from Soulsuck24/development

This commit is contained in:
Serene 2022-12-12 10:03:42 +10:00 committed by GitHub
commit b4fccd7ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -41,7 +41,7 @@ class Imgur(BaseDownloader):
@staticmethod
def _get_data(link: str) -> dict:
try:
imgur_id = re.match(r".*/(.*?)(\..{0,})?$", link).group(1)
imgur_id = re.match(r".*/(.*?)(_d)?(\..{0,})?$", link).group(1)
gallery = "a/" if re.search(r".*/(.*?)(gallery/|a/)", link) else ""
link = f"https://imgur.com/{gallery}{imgur_id}"
except AttributeError:

View file

@ -170,6 +170,10 @@ def test_imgur_extension_validation_bad(test_extension: str):
"http://i.imgur.com/s9uXxlq.jpg?5.jpg",
("338de3c23ee21af056b3a7c154e2478f",),
),
(
"https://i.imgur.com/2TtN68l_d.webp",
("6569ab9ad9fa68d93f6b408f112dd741",),
),
),
)
def test_find_resources(test_url: str, expected_hashes: list[str]):