mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-19 09:45:47 -04:00
Raise IneligibleError if featured lists are accessed with Deezloader
This commit is contained in:
parent
22d2a649ce
commit
0b22c36c4e
4 changed files with 10 additions and 5 deletions
|
@ -183,7 +183,7 @@ class DiscoverCommand(Command):
|
||||||
"$ <cmd>rip discover</cmd>\n\n"
|
"$ <cmd>rip discover</cmd>\n\n"
|
||||||
"Browse the best-sellers list\n"
|
"Browse the best-sellers list\n"
|
||||||
"$ <cmd>rip discover best-sellers</cmd>\n\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"
|
" • most-streamed\n"
|
||||||
" • recent-releases\n"
|
" • recent-releases\n"
|
||||||
" • best-sellers\n"
|
" • best-sellers\n"
|
||||||
|
@ -203,7 +203,7 @@ class DiscoverCommand(Command):
|
||||||
"$ <cmd>rip discover --source deezer</cmd>\n\n"
|
"$ <cmd>rip discover --source deezer</cmd>\n\n"
|
||||||
"Browse the Deezer charts\n"
|
"Browse the Deezer charts\n"
|
||||||
"$ <cmd>rip discover --source deezer charts</cmd>\n\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"
|
" • releases\n"
|
||||||
" • charts\n"
|
" • charts\n"
|
||||||
" • selection\n"
|
" • selection\n"
|
||||||
|
|
|
@ -26,6 +26,7 @@ from streamrip.clients import (
|
||||||
from streamrip.constants import MEDIA_TYPES
|
from streamrip.constants import MEDIA_TYPES
|
||||||
from streamrip.exceptions import (
|
from streamrip.exceptions import (
|
||||||
AuthenticationError,
|
AuthenticationError,
|
||||||
|
IneligibleError,
|
||||||
ItemExists,
|
ItemExists,
|
||||||
MissingCredentials,
|
MissingCredentials,
|
||||||
NonStreamable,
|
NonStreamable,
|
||||||
|
@ -653,7 +654,14 @@ class RipCore(list):
|
||||||
logger.debug("searching for %s", query)
|
logger.debug("searching for %s", query)
|
||||||
|
|
||||||
client = self.get_client(source)
|
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)
|
results = client.search(query, media_type)
|
||||||
|
|
||||||
if media_type == "featured":
|
if media_type == "featured":
|
||||||
media_type = "album"
|
media_type = "album"
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,6 @@ class DeezerClient(Client):
|
||||||
try:
|
try:
|
||||||
if media_type == "featured":
|
if media_type == "featured":
|
||||||
if query:
|
if query:
|
||||||
print(query)
|
|
||||||
search_function = getattr(
|
search_function = getattr(
|
||||||
self.client.api, f"get_editorial_{query}"
|
self.client.api, f"get_editorial_{query}"
|
||||||
)
|
)
|
||||||
|
|
|
@ -303,8 +303,6 @@ class Track(Media):
|
||||||
url_id = self.id
|
url_id = self.id
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(url_id)
|
|
||||||
print(self.quality)
|
|
||||||
dl_info = self.client.get_file_url(url_id, self.quality)
|
dl_info = self.client.get_file_url(url_id, self.quality)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(repr(e))
|
logger.debug(repr(e))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue