Update download_factory.py
Attempt to fix #724 Narrows down characters available to extensions in the regex. Outside of 3 and 4, the only extensions that I can think of this doesn't hit are bz2 and 7z (which wasn't caught before).
This commit is contained in:
@@ -30,7 +30,7 @@ class DownloadFactory:
|
|||||||
return Imgur
|
return Imgur
|
||||||
elif re.match(r"(i\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
|
elif re.match(r"(i\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
|
||||||
return Redgifs
|
return Redgifs
|
||||||
elif re.match(r".*/.*\.\w{3,4}(\?[\w;&=]*)?$", sanitised_url) and not DownloadFactory.is_web_resource(
|
elif re.match(r".*/.*\.[a-zA-Z34]{3,4}(\?[\w;&=]*)?$", sanitised_url) and not DownloadFactory.is_web_resource(
|
||||||
sanitised_url
|
sanitised_url
|
||||||
):
|
):
|
||||||
return Direct
|
return Direct
|
||||||
|
|||||||
Reference in New Issue
Block a user