diff --git a/bdfrx/site_downloaders/download_factory.py b/bdfrx/site_downloaders/download_factory.py index 9d40225..578e957 100644 --- a/bdfrx/site_downloaders/download_factory.py +++ b/bdfrx/site_downloaders/download_factory.py @@ -23,6 +23,8 @@ class DownloadFactory: @staticmethod def pull_lever(url: str) -> type[BaseDownloader]: # noqa: PLR0911,PLR0912 + if not url: + raise NotADownloadableLinkError("No url provided by the reddit API") sanitised_url = DownloadFactory.sanitise_url(url).lower() if re.match(r"(i\.|m\.|o\.)?imgur", sanitised_url): return Imgur diff --git a/tests/site_downloaders/test_erome.py b/tests/site_downloaders/test_erome.py index 6e114d3..de14840 100644 --- a/tests/site_downloaders/test_erome.py +++ b/tests/site_downloaders/test_erome.py @@ -12,15 +12,18 @@ ( ("https://www.erome.com/a/vqtPuLXh", (r"https://[a-z]\d+.erome.com/\d{3}/vqtPuLXh/KH2qBT99_480p.mp4",)), ( - "https://www.erome.com/a/ORhX0FZz", + "https://www.erome.com/a/9E50Xkb6", ( - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/9IYQocM9_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/9eEDc8xm_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/EvApC7Rp_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/LruobtMs_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/TJNmSUU5_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/X11Skh6Z_480p.mp4", - r"https://[a-z]\d+.erome.com/\d{3}/ORhX0FZz/bjlTkpn7_480p.mp4", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/hUpc1d21.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/3zZF7uv4.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/h6C03hNq.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/AHQuZh9j.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/Ram0NmDU.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/dY82guy1.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/3x8bp9lF.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/lxyFSUMQ.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/vPIb29UR.jpeg", + r"https://[a-z]\d+.erome.com/\d{4}/9E50Xkb6/w1BJtyh5.jpeg", ), ), ), diff --git a/tests/site_downloaders/test_imgur.py b/tests/site_downloaders/test_imgur.py index 501bcc7..c3f08be 100644 --- a/tests/site_downloaders/test_imgur.py +++ b/tests/site_downloaders/test_imgur.py @@ -80,7 +80,6 @@ def test_get_id(test_url: str, expected: str): ("https://imgur.com/a/1qzfWtY/gifv", ("65fbc7ba5c3ed0e3af47c4feef4d3735",)), ("https://imgur.com/a/1qzfWtY/mp4", ("65fbc7ba5c3ed0e3af47c4feef4d3735",)), ("https://imgur.com/a/1qzfWtY/spqr", ("65fbc7ba5c3ed0e3af47c4feef4d3735",)), - ("https://i.imgur.com/expO7Rc.gifv", ("e309f98158fc98072eb2ae68f947f421",)), ("https://i.imgur.com/a/aqpiMuL.gif", ("5b2a9a5218bf43dc26ba41389410c981",)), ), )