Add support for direct links with parameters
This commit is contained in:
parent
4b49991cd6
commit
c2c3d03205
@ -24,7 +24,7 @@ class DownloadFactory:
|
||||
url_beginning = r'\s*(https?://(www\.)?)'
|
||||
if re.match(url_beginning + r'i\.imgur.*\.gifv$', url):
|
||||
return Imgur
|
||||
elif re.match(url_beginning + r'.*/.*\.\w{3,4}$', url):
|
||||
elif re.match(url_beginning + r'.*/.*\.\w{3,4}(\?[\w;&=]*)?$', url):
|
||||
return Direct
|
||||
elif re.match(url_beginning + r'erome\.com.*', url):
|
||||
return Erome
|
||||
|
@ -37,6 +37,8 @@ from bulkredditdownloader.site_downloaders.youtube import Youtube
|
||||
('https://www.gifdeliverynetwork.com/repulsivefinishedandalusianhorse', GifDeliveryNetwork),
|
||||
('https://youtu.be/DevfjHOhuFc', Youtube),
|
||||
('https://m.youtube.com/watch?v=kr-FeojxzUM', Youtube),
|
||||
('https://i.imgur.com/3SKrQfK.jpg?1', Direct),
|
||||
('https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781', Direct),
|
||||
))
|
||||
def test_factory_lever_good(test_submission_url: str, expected_class: BaseDownloader, reddit_instance: praw.Reddit):
|
||||
result = DownloadFactory.pull_lever(test_submission_url)
|
||||
|
Loading…
Reference in New Issue
Block a user