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