Add fix for Imgur gifv links
This commit is contained in:
@@ -37,7 +37,7 @@ class Imgur(BaseDownloader):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_data(link: str) -> dict:
|
def _get_data(link: str) -> dict:
|
||||||
if re.match(r'.*i\.imgur\.com.*\.gifv$', link):
|
if re.match(r'.*\.gifv$', link):
|
||||||
link = link.replace('i.imgur', 'imgur')
|
link = link.replace('i.imgur', 'imgur')
|
||||||
link = link.rstrip('.gifv')
|
link = link.rstrip('.gifv')
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ def test_get_data_album(test_url: str, expected_gen_dict: dict, expected_image_d
|
|||||||
('https://i.imgur.com/dLk3FGY.gifv',
|
('https://i.imgur.com/dLk3FGY.gifv',
|
||||||
{'hash': 'dLk3FGY', 'title': '', 'ext': '.mp4', 'animated': True}
|
{'hash': 'dLk3FGY', 'title': '', 'ext': '.mp4', 'animated': True}
|
||||||
),
|
),
|
||||||
|
('https://imgur.com/BuzvZwb.gifv',
|
||||||
|
{'hash': 'BuzvZwb', 'title': '', 'description': 'Akron Glass Works', 'animated': True, 'mimetype': 'video/mp4'},
|
||||||
|
)
|
||||||
))
|
))
|
||||||
def test_get_data_gif(test_url: str, expected_image_dict: dict):
|
def test_get_data_gif(test_url: str, expected_image_dict: dict):
|
||||||
result = Imgur._get_data(test_url)
|
result = Imgur._get_data(test_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user