Update examples
...just to make it clear.
This commit is contained in:
10
README.md
10
README.md
@@ -29,7 +29,7 @@ from librespot.core import Session
|
|||||||
|
|
||||||
|
|
||||||
session = Session.Builder() \
|
session = Session.Builder() \
|
||||||
.user_pass("<Username>", "<Password>") \
|
.user_pass("Username", "Password") \
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
aceess_token = session.tokens().get("playlist-read")
|
aceess_token = session.tokens().get("playlist-read")
|
||||||
@@ -38,16 +38,16 @@ aceess_token = session.tokens().get("playlist-read")
|
|||||||
\*Currently, music streaming is supported, but it may cause unintended behavior.
|
\*Currently, music streaming is supported, but it may cause unintended behavior.
|
||||||
```python
|
```python
|
||||||
from librespot.core import Session
|
from librespot.core import Session
|
||||||
|
from librespot.metadata import TrackId
|
||||||
|
from librespot.player.codecs import AudioQuality, VorbisOnlyAudioQuality
|
||||||
|
|
||||||
|
|
||||||
session = Session.Builder() \
|
session = Session.Builder() \
|
||||||
.user_pass("<Username>", "<Password>") \
|
.user_pass("Username", "Password") \
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
track_id = TrackId.from_uri("<TrackID(ex, spotify:track:xxxxxxxxxxxxxxxxxxxxxx)>")
|
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
|
||||||
|
|
||||||
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False, None)
|
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
|
# 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user