Raise IneligibleError if featured lists are accessed with Deezloader

This commit is contained in:
Nathan Thomas 2021-08-19 18:25:17 -07:00
parent 22d2a649ce
commit 0b22c36c4e
4 changed files with 10 additions and 5 deletions

View file

@ -183,7 +183,7 @@ class DiscoverCommand(Command):
"$ <cmd>rip discover</cmd>\n\n"
"Browse the best-sellers list\n"
"$ <cmd>rip discover best-sellers</cmd>\n\n"
"Available options for Qobuz <info>list</info>:\n\n"
"Available options for Qobuz <cmd>list</cmd>:\n\n"
" • most-streamed\n"
" • recent-releases\n"
" • best-sellers\n"
@ -203,7 +203,7 @@ class DiscoverCommand(Command):
"$ <cmd>rip discover --source deezer</cmd>\n\n"
"Browse the Deezer charts\n"
"$ <cmd>rip discover --source deezer charts</cmd>\n\n"
"Available options for Deezer <info>list</info>:\n\n"
"Available options for Deezer <cmd>list</cmd>:\n\n"
" • releases\n"
" • charts\n"
" • selection\n"

View file

@ -26,6 +26,7 @@ from streamrip.clients import (
from streamrip.constants import MEDIA_TYPES
from streamrip.exceptions import (
AuthenticationError,
IneligibleError,
ItemExists,
MissingCredentials,
NonStreamable,
@ -653,7 +654,14 @@ class RipCore(list):
logger.debug("searching for %s", query)
client = self.get_client(source)
if isinstance(client, DeezloaderClient) and media_type == "featured":
raise IneligibleError(
"Must have premium Deezer account to access editorial lists."
)
results = client.search(query, media_type)
if media_type == "featured":
media_type = "album"

View file

@ -501,7 +501,6 @@ class DeezerClient(Client):
try:
if media_type == "featured":
if query:
print(query)
search_function = getattr(
self.client.api, f"get_editorial_{query}"
)

View file

@ -303,8 +303,6 @@ class Track(Media):
url_id = self.id
try:
print(url_id)
print(self.quality)
dl_info = self.client.get_file_url(url_id, self.quality)
except Exception as e:
logger.debug(repr(e))