Adding Client to Server patch tyoe info
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
This commit is contained in:
@@ -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.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 librespot.structure import GeneralAudioStream, AudioDecrypt, AudioQualityPicker, Closeable, FeederException, GeneralAudioStream, GeneralWritableStream, HaltListener, NoopAudioDecrypt, PacketsReceiver
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from zotify.config import ZOTIFY_VERSION as _ZOTIFY_VERSION
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
@@ -24,11 +25,12 @@ import os
|
|||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import atexit
|
import atexit
|
||||||
|
|
||||||
if typing.TYPE_CHECKING:
|
if typing.TYPE_CHECKING:
|
||||||
from librespot.core import Session
|
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.
|
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).
|
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,
|
exc,
|
||||||
)
|
)
|
||||||
print(
|
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"
|
"Falling back to SpotiClub API...\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -468,6 +470,8 @@ class AudioKeyManager(PacketsReceiver, Closeable):
|
|||||||
"file_id": util.bytes_to_hex(file_id),
|
"file_id": util.bytes_to_hex(file_id),
|
||||||
"user": spoticlub_user,
|
"user": spoticlub_user,
|
||||||
"password": spoticlub_password,
|
"password": spoticlub_password,
|
||||||
|
"version": _ZOTIFY_VERSION,
|
||||||
|
"type": 0,
|
||||||
}
|
}
|
||||||
if spoticlub_client_serial:
|
if spoticlub_client_serial:
|
||||||
payload["client_serial"] = spoticlub_client_serial
|
payload["client_serial"] = spoticlub_client_serial
|
||||||
|
|||||||
Reference in New Issue
Block a user