Update README.md
This commit is contained in:
18
README.md
18
README.md
@@ -21,7 +21,7 @@ Snapshot Version \***Recommended**
|
|||||||
pip install git+https://github.com/kokarare1212/librespot-python
|
pip install git+https://github.com/kokarare1212/librespot-python
|
||||||
```
|
```
|
||||||
## Usage
|
## Usage
|
||||||
Get Spotify's OAuth token
|
### Get Spotify's OAuth token
|
||||||
```python
|
```python
|
||||||
from librespot.core import Session
|
from librespot.core import Session
|
||||||
|
|
||||||
@@ -32,6 +32,22 @@ session = Session.Builder() \
|
|||||||
|
|
||||||
aceess_token = session.tokens().get("playlist-read")
|
aceess_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
|
||||||
|
|
||||||
|
|
||||||
|
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](https://librespot-python.rtfd.io) for detailed specifications.
|
Please read [this document](https://librespot-python.rtfd.io) for detailed specifications.
|
||||||
## Roadmap
|
## Roadmap
|
||||||
Please read [ROADMAP.md](https://github.com/kokarare1212/librespot-python/blob/main/ROADMAP.md).
|
Please read [ROADMAP.md](https://github.com/kokarare1212/librespot-python/blob/main/ROADMAP.md).
|
||||||
|
|||||||
Reference in New Issue
Block a user