Throw an error when there is no item_id provided to get_downloadable (#547)

Fixes #546
This commit is contained in:
Marek Veselý 2024-01-14 06:54:19 +01:00 committed by GitHub
parent 577d914e93
commit 1271df5ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -137,6 +137,10 @@ class DeezerClient(Client):
quality: int = 2,
is_retry: bool = False,
) -> DeezerDownloadable:
if item_id is None:
raise NonStreamableError(
"No item id provided. This can happen when searching for fallback songs.",
)
# TODO: optimize such that all of the ids are requested at once
dl_info: dict = {"quality": quality, "id": item_id}