This commit is contained in:
Nathan Thomas 2021-08-13 13:40:56 -07:00
parent 9dd9707444
commit b804be4bfb
3 changed files with 10 additions and 5 deletions

View file

@ -368,7 +368,7 @@ class RipCore(list):
if client.source == "deezer" and creds["arl"] == "":
if self.config.session["deezer"]["deezloader_warnings"]:
secho(
"Falling back to Deezloader (max 320kbps MP3). If you have a subscription, run ",
"Falling back to Deezloader (unstable). If you have a subscription, run ",
nl=False,
fg="yellow",
)

View file

@ -614,7 +614,7 @@ class DeezloaderClient(Client):
"""DeezloaderClient."""
source = "deezer"
max_quality = 1
max_quality = 2
def __init__(self):
"""Create a DeezloaderClient."""
@ -671,7 +671,7 @@ class DeezloaderClient(Client):
return item
@staticmethod
def get_file_url(meta_id: Union[str, int], quality: int = 6):
def get_file_url(meta_id: Union[str, int], quality: int = 2):
"""Get downloadable url for a track.
:param meta_id: The track ID.
@ -679,8 +679,8 @@ class DeezloaderClient(Client):
:param quality:
:type quality: int
"""
quality = min(DEEZER_MAX_Q, quality)
url = f"{DEEZER_DL}/{get_quality(quality, 'deezer')}/{DEEZER_BASE}/track/{meta_id}"
quality = min(DeezloaderClient.max_quality, quality)
url = f"{DEEZER_DL}/{get_quality(quality, 'deezloader')}/{DEEZER_BASE}/track/{meta_id}"
logger.debug(f"Download url {url}")
return {"url": url}

View file

@ -180,6 +180,11 @@ __QUALITY_MAP: Dict[str, Dict[int, Union[int, str, Tuple[int, str]]]] = {
2: "LOSSLESS", # CD Quality
3: "HI_RES", # MQA
},
"deezloader": {
0: 128,
1: 320,
2: 1411,
},
}