Fix bug with Imgur gifs being shortened too much
The rstrip function was used wrongly, it doesn't remove a substring but rather removes any of the characters provided, so here it removed any I, G, V, or F that finished the six character ID for Imgur, resulting in a 404 error for the resources in question.
This commit is contained in:
@@ -39,7 +39,7 @@ class Imgur(BaseDownloader):
|
||||
def _get_data(link: str) -> dict:
|
||||
if re.match(r'.*\.gifv$', link):
|
||||
link = link.replace('i.imgur', 'imgur')
|
||||
link = link.rstrip('.gifv')
|
||||
link = re.sub('\\.gifv$', '', link)
|
||||
|
||||
res = Imgur.retrieve_url(link, cookies={'over18': '1', 'postpagebeta': '0'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user