diff --git a/librespot/audio/__init__.py b/librespot/audio/__init__.py index 6a831da..a04a0fc 100644 --- a/librespot/audio/__init__.py +++ b/librespot/audio/__init__.py @@ -9,6 +9,7 @@ from librespot.metadata import EpisodeId, PlayableId, TrackId from librespot.proto import Metadata_pb2 as Metadata, StorageResolve_pb2 as StorageResolve from librespot.structure import GeneralAudioStream, AudioDecrypt, AudioQualityPicker, Closeable, FeederException, GeneralAudioStream, GeneralWritableStream, HaltListener, NoopAudioDecrypt, PacketsReceiver from pathlib import Path +from zotify.config import ZOTIFY_VERSION as _ZOTIFY_VERSION import concurrent.futures import io import logging @@ -24,11 +25,12 @@ import os import json import requests import atexit + if typing.TYPE_CHECKING: from librespot.core import Session """ -PATCH : SpotiClub Audio Key Fetching (v0.2.0) +PATCH : SpotiClub Audio Key Fetching Fetches the audio decryption key from the SpotiClub Audio Key API instead of Spotify directly. This is a workaround for Spotify's tightened restrictions on Audio Key access (they allow only Premium Tier now). @@ -430,7 +432,7 @@ class AudioKeyManager(PacketsReceiver, Closeable): exc, ) print( - "\n[AudioKey] Spotify refused or failed to provide the audio key. " + "\n[Warning] Spotify refused or failed to provide the audio key for this track." "Falling back to SpotiClub API...\n" ) @@ -468,6 +470,8 @@ class AudioKeyManager(PacketsReceiver, Closeable): "file_id": util.bytes_to_hex(file_id), "user": spoticlub_user, "password": spoticlub_password, + "version": _ZOTIFY_VERSION, + "type": 0, } if spoticlub_client_serial: payload["client_serial"] = spoticlub_client_serial