Catch some Imgur errors with weird links
This commit is contained in:
@@ -37,9 +37,10 @@ class Imgur(BaseDownloader):
|
||||
|
||||
@staticmethod
|
||||
def _get_data(link: str) -> dict:
|
||||
if re.match(r'.*\.gifv$', link):
|
||||
link = link.rstrip('?')
|
||||
if re.match(r'(?i).*\.gifv$', link):
|
||||
link = link.replace('i.imgur', 'imgur')
|
||||
link = re.sub('\\.gifv$', '', link)
|
||||
link = re.sub('(?i)\\.gifv$', '', link)
|
||||
|
||||
res = Imgur.retrieve_url(link, cookies={'over18': '1', 'postpagebeta': '0'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user