Remove Streamable downloader module

This commit is contained in:
Serene-Arc
2021-05-02 19:53:01 +10:00
committed by Serene
parent fba70dcf18
commit ab96a3ba97
4 changed files with 1 additions and 52 deletions

View File

@@ -15,7 +15,6 @@ from bdfr.site_downloaders.gfycat import Gfycat
from bdfr.site_downloaders.imgur import Imgur from bdfr.site_downloaders.imgur import Imgur
from bdfr.site_downloaders.redgifs import Redgifs 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.streamable import Streamable
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
@@ -44,8 +43,6 @@ 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
elif YoutubeDlFallback.can_handle_link(sanitised_url): elif YoutubeDlFallback.can_handle_link(sanitised_url):

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env python3
import logging
from typing import Optional
from praw.models import Submission
from bdfr.resource import Resource
from bdfr.site_authenticator import SiteAuthenticator
from bdfr.site_downloaders.youtube import Youtube
logger = logging.getLogger(__name__)
class Streamable(Youtube):
def __init__(self, post: Submission):
super().__init__(post)
def find_resources(self, authenticator: Optional[SiteAuthenticator] = None) -> list[Resource]:
out = super()._download_video({})
return [out]

View File

@@ -15,7 +15,6 @@ from bdfr.site_downloaders.gfycat import Gfycat
from bdfr.site_downloaders.imgur import Imgur from bdfr.site_downloaders.imgur import Imgur
from bdfr.site_downloaders.redgifs import Redgifs 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.streamable import Streamable
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
@@ -43,7 +42,7 @@ from bdfr.site_downloaders.youtube import Youtube
('https://i.imgur.com/3SKrQfK.jpg?1', Direct), ('https://i.imgur.com/3SKrQfK.jpg?1', Direct),
('https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781', Direct), ('https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781', Direct),
('https://m.imgur.com/a/py3RW0j', Imgur), ('https://m.imgur.com/a/py3RW0j', Imgur),
('https://streamable.com/dt46y', Streamable), ('https://streamable.com/dt46y', YoutubeDlFallback),
('https://vimeo.com/channels/31259/53576664', YoutubeDlFallback), ('https://vimeo.com/channels/31259/53576664', YoutubeDlFallback),
('http://video.pbs.org/viralplayer/2365173446/', YoutubeDlFallback), ('http://video.pbs.org/viralplayer/2365173446/', YoutubeDlFallback),
)) ))

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env python3
# coding=utf-8
from unittest.mock import MagicMock
import pytest
from bdfr.resource import Resource
from bdfr.site_downloaders.streamable import Streamable
@pytest.mark.online
@pytest.mark.slow
@pytest.mark.parametrize(('test_url', 'expected_hash'), (
('https://streamable.com/dt46y', '1e7f4928e55de6e3ca23d85cc9246bbb'),
('https://streamable.com/t8sem', '49b2d1220c485455548f1edbc05d4ecf')
))
def test_find_resources(test_url: str, expected_hash: str):
test_submission = MagicMock()
test_submission.url = test_url
downloader = Streamable(test_submission)
resources = downloader.find_resources()
assert len(resources) == 1
assert isinstance(resources[0], Resource)
resources[0].download(120)
assert resources[0].hash.hexdigest() == expected_hash