1
0
Fork 0
mirror of synced 2024-06-21 11:40:21 +12:00

Add Streamable to download factory

This commit is contained in:
Daniel Clowry 2021-04-29 19:06:37 +10:00 committed by Serene
parent 2c54cd740a
commit e6d2980db3

View file

@ -16,6 +16,7 @@ from bdfr.site_downloaders.redgifs import Redgifs
from bdfr.site_downloaders.self_post import SelfPost
from bdfr.site_downloaders.vreddit import VReddit
from bdfr.site_downloaders.youtube import Youtube
from bdfr.site_downloaders.streamable import Streamable
class DownloadFactory:
@ -42,10 +43,13 @@ class DownloadFactory:
return VReddit
elif re.match(r'(m\.)?youtu\.?be', sanitised_url):
return Youtube
elif re.match(r'streamable\.com', sanitised_url):
return Streamable
elif re.match(r'i\.redd\.it.*', sanitised_url):
return Direct
else:
raise NotADownloadableLinkError(f'No downloader module exists for url {url}')
raise NotADownloadableLinkError(
f'No downloader module exists for url {url}')
@staticmethod
def _sanitise_url(url: str) -> str: