diff --git a/README.md b/README.md index 562bf6c..5e393d2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Snapshot Version \***Recommended** pip install git+https://github.com/kokarare1212/librespot-python ``` ## Usage -Get Spotify's OAuth token +### Get Spotify's OAuth token ```python from librespot.core import Session @@ -32,6 +32,22 @@ session = Session.Builder() \ 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("", "") \ + .create() + +track_id = TrackId.from_uri("") + +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. ## Roadmap Please read [ROADMAP.md](https://github.com/kokarare1212/librespot-python/blob/main/ROADMAP.md).