Imgur updates
Update Imgur logic to cover malformed links that cause a redirect leading to the html of the page being saved as an image.
This commit is contained in:
@@ -25,7 +25,7 @@ class DownloadFactory:
|
||||
@staticmethod
|
||||
def pull_lever(url: str) -> Type[BaseDownloader]:
|
||||
sanitised_url = DownloadFactory.sanitise_url(url)
|
||||
if re.match(r'(i\.)?imgur.*\.gif.+$', sanitised_url):
|
||||
if re.match(r'(i\.|m\.)?imgur', sanitised_url):
|
||||
return Imgur
|
||||
elif re.match(r'.*/.*\.\w{3,4}(\?[\w;&=]*)?$', sanitised_url) and \
|
||||
not DownloadFactory.is_web_resource(sanitised_url):
|
||||
@@ -38,8 +38,6 @@ class DownloadFactory:
|
||||
return Gallery
|
||||
elif re.match(r'gfycat\.', sanitised_url):
|
||||
return Gfycat
|
||||
elif re.match(r'(m\.)?imgur.*', sanitised_url):
|
||||
return Imgur
|
||||
elif re.match(r'(redgifs|gifdeliverynetwork)', sanitised_url):
|
||||
return Redgifs
|
||||
elif re.match(r'reddit\.com/r/', sanitised_url):
|
||||
|
||||
Reference in New Issue
Block a user