A webserver acting as an intermediary between lavaplayer/lavalink and Spotify.
This webserver is an actual Spotify player and not using Youtube or something like that.
THIS ONLY WORKS ON PREMIUM ACCOUNT
I am not responsible if your account got banned, this webserver still possibly breaks Spotify ToS since it falls into account sharing.
I would recommend a burner premium account.
Vorbis
-> MP3
(AAC is currently disabled because it's broken)VERY_HIGH
> HIGH
> NORMAL
)To use this webserver, you need to prepare a python virtual environment.
virtualenv
if you dont have it. (pip install virtualenv -U
)virtualenv venv
.\venv\Scripts\activate
source ./venv/bin/activate
pip install -U -r requirements.txt
.env.example
file to .env
and fill in.
python3 app.py
, make sure you're in the virtualenv.https://127.0.0.1:37784/:track_id/listen
:track_id
need to be changed into Spotify hex ID, for example:
https://open.spotify.com/track/5erw0k8hLca8iP36AhFMsE
will have the track ID of: 5erw0k8hLca8iP36AhFMsE
In .env.example
you will find 3 options:
SPOTILAVA_USERNAME
, fill this with your Spotify email or usernameSPOTILAVA_PASSWORD
, fill this with your Spotify passwordSPOTILAVA_CHUNK_SIZE
, the chunk size of the send.
Please make sure it's a multiple of 8 and not less than 4096, I recommend not changing it./:track_id
get the metadata of the track ID. (JSON)/:track_id/listen
get the track itself, returns the OGG Vorbis or MP3 stream. (Binary)
q
parameter to adjust quality (quality
, qual
)
low
for the lowest quality (lowest
, lq
)normal
for the "normal" or "high" quality (medium
)high
for the highest quality (highest
, hq
)format
parameter to adjust format (fmt
)
mp3
to force MP3 formataac
to force AAC format (m4a
)vorbis
to force Vorbis format (opus
, ogg
)/:track_id/lyrics
get the track lyrics (if available) (JSON)/album/:album_id/
get the list of Album data. (JSON)/playlist/:playlist_id
get the list of playlist data. (JSON)/show/:show_id/
get the list of Show/Podcast data. (JSON)/artist/:artist_id/
get the list of artist top tracks. (JSON) [See note at the bottom]/episode/:episode_id
get the metadata of a podcast episode. (JSON)/episode/:episode_id/listen
get the episode itself, returns an OGG Vorbis or MP3 stream. (Binary)
q
parameter to adjust quality (quality
, qual
)
low
for the lowest quality (lowest
, lq
)normal
for the "normal" or "high" quality (medium
)high
for the highest quality (highest
, hq
)format
parameter to adjust format (fmt
)
mp3
to force MP3 formataac
to force AAC format (m4a
)vorbis
to force Vorbis format (opus
, ogg
)The other API can be used to fetch about playlist/album/track information before requesting lavaplayer the real URL (/:track_id/listen
).
I'm planning to implement support for Shows/Podcast too.
Implemented since commit: d54fdd9
Note on top artist tracks:
It will use your account country as what the top tracks are for the artist in that country.
Spotilava includes some extension that support other premium music provider like Tidal, learn more here.
I'm using an external library called librespot-python which is still maintained and use the original librespot implementation which is an Open Spotify Client.
The program will then request the input stream of the file with librespot-python
help, and then will do this:
Lavaplayer would just return an UNDEFINED_LENGTH
a.k.a the longest number you can put on Java.
spotify.APReponseMessage
I cannot fix this currently since this is most likely a failure from librespot-python
itself. You can just start the server again to see if it's works.
Created new session! device_id xxxxxxxxx
and not finished connecting.This problem might be fixed at commit d1f951f
since the upstream librespot-python
fixes the freezing if the previous auth failed, or the client is not disconnected properly.
Unknown problems to me, some tracks (mainly OGG one) will throws errors after the track playback is ended. See #4
This project is licensed with MIT License.
If you like this project, consider donating to me: https://n4o.xyz/#/donate