From 7228bc572cb970950e6df2d696d366910f726705 Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Tue, 6 Apr 2021 16:38:52 +0300 Subject: [PATCH] Add //imgur.com/*.gifv --- bulkredditdownloader/site_downloaders/download_factory.py | 2 +- .../tests/site_downloaders/test_download_factory.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bulkredditdownloader/site_downloaders/download_factory.py b/bulkredditdownloader/site_downloaders/download_factory.py index 0bbd231..a1aad75 100644 --- a/bulkredditdownloader/site_downloaders/download_factory.py +++ b/bulkredditdownloader/site_downloaders/download_factory.py @@ -22,7 +22,7 @@ class DownloadFactory: @staticmethod def pull_lever(url: str) -> Type[BaseDownloader]: url_beginning = r'\s*(https?://(www\.)?)' - if re.match(url_beginning + r'i\.imgur.*\.gifv$', url): + if re.match(url_beginning + r'(i\.)?imgur.*\.gifv$', url): return Imgur elif re.match(url_beginning + r'.*/.*\.\w{3,4}(\?[\w;&=]*)?$', url): return Direct diff --git a/bulkredditdownloader/tests/site_downloaders/test_download_factory.py b/bulkredditdownloader/tests/site_downloaders/test_download_factory.py index e6bb7f4..935bac3 100644 --- a/bulkredditdownloader/tests/site_downloaders/test_download_factory.py +++ b/bulkredditdownloader/tests/site_downloaders/test_download_factory.py @@ -27,6 +27,7 @@ from bulkredditdownloader.site_downloaders.youtube import Youtube ('https://i.redd.it/affyv0axd5k61.png', Direct), ('https://imgur.com/3ls94yv.jpeg', Direct), ('https://i.imgur.com/BuzvZwb.gifv', Imgur), + ('https://imgur.com/BuzvZwb.gifv', Imgur), ('https://i.imgur.com/6fNdLst.gif', Direct), ('https://imgur.com/a/MkxAzeg', Imgur), ('https://www.reddit.com/gallery/lu93m7', Gallery),