Merge pull request #728 from OMEGARAZER/patch-1

fix https://github.com/aliparlakci/bulk-downloader-for-reddit/issues/724
This commit is contained in:
Serene
2022-12-20 21:58:12 +10:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ class DownloadFactory:
return Imgur
elif re.match(r"(i\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
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
):
return Direct

View File

@@ -65,6 +65,7 @@ def test_factory_lever_good(test_submission_url: str, expected_class: BaseDownlo
"https://www.google.com",
"https://www.google.com/test",
"https://www.google.com/test/",
"https://www.tiktok.com/@keriberry.420",
),
)
def test_factory_lever_bad(test_url: str):