Open Source Spotify Client
Go to file
Restyled.io a8386ddbd9 Restyled by prettier-yaml 2021-04-09 23:04:49 +00:00
.github/workflows Create codeql-analysis.yml 2021-03-29 11:22:35 +09:00
docs Edit Document 2021-02-25 18:44:16 +09:00
librespot Change Directory Layouts 2021-03-08 12:18:47 +09:00
proto Initial Commit 2021-02-24 08:46:59 +09:00
.gitignore Add player state 2021-02-25 18:22:28 +09:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2021-04-06 07:11:20 +09:00
LICENSE.txt Initial Commit 2021-02-24 08:46:59 +09:00
README.md Update README.md 2021-04-06 07:13:13 +09:00
ROADMAP.md Update ROADMAP.md 2021-03-28 16:00:54 +09:00
requirements.txt Update requirements.txt 2021-03-28 16:03:26 +09:00
setup.py Change Directory 2021-02-25 08:07:17 +09:00
sider.yml Restyled by prettier-yaml 2021-04-09 23:04:49 +00:00

README.md

License Stars Forks

Librespot-Python

Open Source Spotify Client

About The Project

This project was developed to make the music streaming service Spotify available on any device.

Note

It is still in the idea stage, so there is a possibility of unintended behavior or major specification changes.
We DO NOT encourage piracy and DO NOT support any form of downloader/recorder designed with the help of this repository and in general anything that goes against the Spotify ToS.
For other guidelines, please see CODE_OF_CONDUCT.md.

Getting Started

Prerequisites

Installation

Stable Version *still not working.

pip install librespot

Snapshot Version *Recommended

pip install git+https://github.com/kokarare1212/librespot-python

Usage

Get Spotify's OAuth token

from librespot.core import Session


session = Session.Builder() \
    .user_pass("<Username>", "<Password>") \
    .create()

aceess_token = session.tokens().get("playlist-read")

Get Music Stream

*Currently, music streaming is supported, but it may cause unintended behavior.

from librespot.core import Session


session = Session.Builder() \
    .user_pass("<Username>", "<Password>") \
    .create()

track_id = TrackId.from_uri("<TrackID(ex, spotify:track:xxxxxxxxxxxxxxxxxxxxxx)>")

stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False, None)

# stream.input_stream.stream().read() to get one byte of the music stream

Please read this document for detailed specifications.

Roadmap

Please read ROADMAP.md.

Contributing

Pull requests are welcome.

License

Distributed under the Apache-2.0 License. See LICENSE.txt for more information.

Special thanks

Coming soon