Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kokarare1212/librespot-python
Open Source Spotify Client
https://github.com/kokarare1212/librespot-python
hacktoberfest librespot librespot-python music-streaming python roadmap
Last synced: 23 days ago
JSON representation
Open Source Spotify Client
- Host: GitHub
- URL: https://github.com/kokarare1212/librespot-python
- Owner: kokarare1212
- License: apache-2.0
- Created: 2021-02-23T23:44:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T12:52:06.000Z (30 days ago)
- Last Synced: 2024-11-28T23:37:56.108Z (23 days ago)
- Topics: hacktoberfest, librespot, librespot-python, music-streaming, python, roadmap
- Language: Python
- Homepage: http://librespot-python.rtfd.io
- Size: 897 KB
- Stars: 240
- Watchers: 8
- Forks: 46
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: docs/supported.md
Awesome Lists containing this project
README
![License](https://img.shields.io/github/license/kokarare1212/librespot-python.svg)
![Stars](https://img.shields.io/github/stars/kokarare1212/librespot-python.svg)
![Forks](https://img.shields.io/github/forks/kokarare1212/librespot-python.svg)
[![DeepSource](https://deepsource.io/gh/kokarare1212/librespot-python.svg/?label=active+issues&show_trend=true)](https://deepsource.io/gh/kokarare1212/librespot-python/?ref=repository-badge)![Counter](https://count.getloli.com/get/@librespot-python?theme=moebooru)
# Librespot-Python
Open Source Spotify Client
## Support Project
If you find our project useful and want to support its development, please consider making a donation. Your contribution will help us maintain and improve the project, ensuring that it remains free and accessible to everyone.
[![GitHub Sponsor](https://img.shields.io/github/sponsors/kokarare1212?label=GitHub%20Sponsor&logo=GitHub)](https://github.com/sponsors/kokarare1212)
[![Liberapay receiving](https://img.shields.io/liberapay/receives/kokarare1212?label=Liberapay&logo=Liberapay)](https://liberapay.com/kokarare1212/)## About The Project
This project was developed to make the music streaming service Spotify available
on any device.## Attention!
This repository has been completely rewritten from the transplant.
There may be some functions that are not implemented yet.
If so, please feel free to open an issue.## 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](https://github.com/kokarare1212/librespot-python/blob/main/CODE_OF_CONDUCT.md).## Getting Started
### Prerequisites
- [Python](https://python.org/)
### Installation
Stable Version
```commandline
pip install librespot
```Snapshot Version \***Recommended**
```commandline
pip install git+https://github.com/kokarare1212/librespot-python
```## Usage
### Use Zeroconf for Login
```python
from librespot.zeroconf import ZeroconfServerzeroconf = ZeroconfServer.Builder().create()
```### Get Spotify's OAuth token
```python
from librespot.core import Sessionsession = Session.Builder() \
.user_pass("Username", "Password") \
.create()access_token = session.tokens().get("playlist-read")
```### Get Music Stream
*Currently, music streaming is supported, but it may cause unintended behavior.
```python
from librespot.core import Session
from librespot.metadata import TrackId
from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQualitysession = Session.Builder() \
.user_pass("Username", "Password") \
.create()track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
# stream.input_stream.stream().read() to get one byte of the music stream.
```Other uses are
[examples](https://github.com/kokarare1212/librespot-python/tree/main/examples)
or read [this document](https://librespot-python.rtfd.io) for detailed
specifications.## Debug
To display the debug information, you need to inject the following code at the
top of the code.```python
import logginglogging.basicConfig(level=logging.DEBUG)
```## Contributing
Pull requests are welcome.
## License
Distributed under the Apache-2.0 License. See
[LICENSE.txt](https://github.com/kokarare1212/librespot-python/blob/main/LICENSE.txt)
for more information.## Related Projects
- [Librespot](https://github.com/librespot-org/librespot) (Concept)
- [Librespot-Java](https://github.com/librespot-org/librespot-java) (Core)