Fix downloading .gifv instead of .mp4 (#228)
This commit is contained in:
parent
58150570a3
commit
247fe3e6f7
@ -30,7 +30,7 @@ class DownloadFactory:
|
||||
return Gfycat
|
||||
elif re.match(url_beginning + r'gifdeliverynetwork', url):
|
||||
return GifDeliveryNetwork
|
||||
elif re.match(url_beginning + r'imgur.*', url):
|
||||
elif re.match(url_beginning + r'imgur.*', url) or re.match(url_beginning + r'i\.imgur.*\.gifv$', url):
|
||||
return Imgur
|
||||
elif re.match(url_beginning + r'redgifs.com', url):
|
||||
return Redgifs
|
||||
|
@ -38,6 +38,8 @@ class Imgur(BaseDownloader):
|
||||
|
||||
@staticmethod
|
||||
def _get_data(link: str) -> dict:
|
||||
if re.match(r".*i\.imgur\.com.*\.gifv$", link):
|
||||
link = link.replace("i.imgur", "imgur")[:-5]
|
||||
res = requests.get(link, cookies={'over18': '1', 'postpagebeta': '0'})
|
||||
|
||||
if res.status_code != 200:
|
||||
|
Loading…
Reference in New Issue
Block a user