From 8d718e1574a8a89c2e66a2d3e1f43c9178f404b7 Mon Sep 17 00:00:00 2001 From: kokarare1212 Date: Mon, 17 May 2021 07:10:45 +0900 Subject: [PATCH] Update document --- docs/index.md | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index a884a67..342fa4a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,27 +7,45 @@ * [Supported Futures](supported.md) * [API Reference](api.md) ## What's librespot-python? -| librespot-python is a python port of Spotify's open source client library [librespot](https://github.com/librespot-org/librespot). -| It was created to play Spotify on various platforms and devices. + +librespot-python is a python port of Spotify's open source client library [librespot](https://github.com/librespot-org/librespot). + +It was created to play Spotify on various platforms and devices. + ## What do you need? -| In order to develop with this library, you need to use Python. -| Python can be downloaded from [the official website here](https://python.org/). + +In order to develop with this library, you need to use Python. + +Python can be downloaded from [the official website here](https://python.org/). + ## Disclaimer -| Please keep in mind that this library is not like Spotify approved. -| Therefore, the worst that can happen is that you will be banned from Spotify. -| Also, please keep in mind that this library is in alpha and may behave in unintended ways. + +Please keep in mind that this library is not like Spotify approved. + +Therefore, the worst that can happen is that you will be banned from Spotify. + +Also, please keep in mind that this library is in alpha and may behave in unintended ways. + ## Installation -| You can download this library in the following way. -| Stable Version ***still not working.** + +You can download this library in the following way. + +Stable Version ***still not working.** + ```commandline pip install librespot ``` -| Snapshot Version ***Recommended** + +Snapshot Version ***Recommended** + ```commandline pip install git+https://github.com/kokarare1212/librespot-python ``` + ## Usage + ### Get Spotify's OAuth token + ```python from librespot.core import Session @@ -38,8 +56,11 @@ session = Session.Builder() \ aceess_token = session.tokens().get("playlist-read") ``` + ### Get Music Stream -| *Currently, music streaming is supported, but it may cause unintended behavior. + +*Currently, music streaming is supported, but it may cause unintended behavior. + ```python from librespot.core import Session from librespot.metadata import TrackId @@ -55,8 +76,11 @@ stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQua # stream.input_stream.stream().read() to get one byte of the music stream. # ex: 1 (If there is no more voice data, -1 is received as the result.) ``` + ## Debug -| To display the debug information, you need to inject the following code at the top of the code. + +To display the debug information, you need to inject the following code at the top of the code. + ```python import logging