Download purchased music without active subscription (vitiko98/qobuz-dl#261)

This commit is contained in:
Wojciech Kozlowski 2024-10-20 22:00:23 +02:00
parent 8096e6cf65
commit 9c939030f2

View File

@ -123,13 +123,14 @@ class Client:
return r.json() return r.json()
def auth(self, email, pwd): def auth(self, email, pwd):
# https://github.com/vitiko98/qobuz-dl/issues/261
usr_info = self.api_call("user/login", email=email, pwd=pwd) usr_info = self.api_call("user/login", email=email, pwd=pwd)
if not usr_info["user"]["credential"]["parameters"]: # if not usr_info["user"]["credential"]["parameters"]:
raise IneligibleError("Free accounts are not eligible to download tracks.") # raise IneligibleError("Free accounts are not eligible to download tracks.")
self.uat = usr_info["user_auth_token"] self.uat = usr_info["user_auth_token"]
self.session.headers.update({"X-User-Auth-Token": self.uat}) self.session.headers.update({"X-User-Auth-Token": self.uat})
self.label = usr_info["user"]["credential"]["parameters"]["short_label"] # self.label = usr_info["user"]["credential"]["parameters"]["short_label"]
logger.info(f"{GREEN}Membership: {self.label}") # logger.info(f"{GREEN}Membership: {self.label}")
def multi_meta(self, epoint, key, id, type): def multi_meta(self, epoint, key, id, type):
total = 1 total = 1