Spotizerr's python librespot implementation
Project description
librespot-spotizerr
Spotizerr's librespot python integration
About The Project
This project is to further add more features for the spotizerr project, forked from librespot-python
Getting Started
Prerequisites
Installation
Stable Version
pip install librespot
Snapshot Version *Recommended
pip install git+https://github.com/Xoconoch/librespot-spotizerr
Usage
Use Zeroconf for Login (no premium required)
from librespot.zeroconf import ZeroconfServer
import time
import logging
import pathlib
zs = ZeroconfServer.Builder().create()
logging.warning("Transfer playback from desktop client to librespot-spotizerr via Spotify Connect in order to store session")
while True:
time.sleep(1)
if zs._ZeroconfServer__session:
logging.warning(f"Grabbed {zs._ZeroconfServer__session} for {zs._ZeroconfServer__session.username()}")
if pathlib.Path("credentials.json").exists():
logging.warning("Session stored in credentials.json. Now you can Ctrl+C")
break
Get Music Stream
*Currently, music streaming is supported, but it may cause unintended behavior.
from librespot.core import Session
from librespot.metadata import TrackId
from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQuality
session = 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 or read this document for detailed specifications.
Debug
To display the debug information, you need to inject the following code at the top of the code.
import logging
logging.basicConfig(level=logging.DEBUG)
Contributing
Pull requests are welcome.
License
Distributed under the GPL yada yada, See LICENSE for more information.
Related Projects
- Librespot (Concept)
- Librespot-Java (Core)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file librespot_spotizerr-0.2.8.tar.gz.
File metadata
- Download URL: librespot_spotizerr-0.2.8.tar.gz
- Upload date:
- Size: 113.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86612f52a0689e3361bc2a43c9ea0d162bbb62fcbeb5e8d170e200247b2a25d8
|
|
| MD5 |
a64fdec58fc7fa30180cdb683d2dec25
|
|
| BLAKE2b-256 |
05101d2de77a74d5c30d817e91eb7dbdfe215f5d63ebad7d02b0063e24cec8e3
|
Provenance
The following attestation bundles were made for librespot_spotizerr-0.2.8.tar.gz:
Publisher:
publish-to-pypi.yml on Xoconoch/librespot-spotizerr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
librespot_spotizerr-0.2.8.tar.gz -
Subject digest:
86612f52a0689e3361bc2a43c9ea0d162bbb62fcbeb5e8d170e200247b2a25d8 - Sigstore transparency entry: 226798101
- Sigstore integration time:
-
Permalink:
Xoconoch/librespot-spotizerr@f108e4a8f1af4ffec36177c609d3312d9a1ddb5d -
Branch / Tag:
refs/tags/v0.2.8 - Owner: https://github.com/Xoconoch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f108e4a8f1af4ffec36177c609d3312d9a1ddb5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file librespot_spotizerr-0.2.8-py3-none-any.whl.
File metadata
- Download URL: librespot_spotizerr-0.2.8-py3-none-any.whl
- Upload date:
- Size: 130.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd50b42795d93fb57e387ad89730055f5ac7c10efec1bb7c11bbb7a667b25e9f
|
|
| MD5 |
62d773b82182302156fec18b6091d49a
|
|
| BLAKE2b-256 |
394afbf4d94a5db11c1df0111da842b05c9fa4f1d90341ebaccd0ae834917a2f
|
Provenance
The following attestation bundles were made for librespot_spotizerr-0.2.8-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Xoconoch/librespot-spotizerr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
librespot_spotizerr-0.2.8-py3-none-any.whl -
Subject digest:
cd50b42795d93fb57e387ad89730055f5ac7c10efec1bb7c11bbb7a667b25e9f - Sigstore transparency entry: 226798102
- Sigstore integration time:
-
Permalink:
Xoconoch/librespot-spotizerr@f108e4a8f1af4ffec36177c609d3312d9a1ddb5d -
Branch / Tag:
refs/tags/v0.2.8 - Owner: https://github.com/Xoconoch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f108e4a8f1af4ffec36177c609d3312d9a1ddb5d -
Trigger Event:
release
-
Statement type: