Update docs
This commit is contained in:
parent
5d9b44f721
commit
f7761a0e49
2 changed files with 30 additions and 9 deletions
|
|
@ -8,14 +8,35 @@ Reference for the YTMusic class.
|
||||||
.. currentmodule:: ytmusicapi
|
.. currentmodule:: ytmusicapi
|
||||||
.. autoclass:: YTMusic
|
.. autoclass:: YTMusic
|
||||||
.. automethod:: YTMusic.__init__
|
.. automethod:: YTMusic.__init__
|
||||||
|
|
||||||
|
Setup
|
||||||
|
-----
|
||||||
|
See also the :doc:`Setup <setup>` page
|
||||||
|
|
||||||
|
.. automethod:: YTMusic.setup
|
||||||
|
|
||||||
|
Search
|
||||||
|
------
|
||||||
.. automethod:: YTMusic.search
|
.. automethod:: YTMusic.search
|
||||||
.. automethod:: YTMusic.get_playlists
|
|
||||||
|
Library
|
||||||
|
-------
|
||||||
.. automethod:: YTMusic.get_liked_songs
|
.. automethod:: YTMusic.get_liked_songs
|
||||||
.. automethod:: YTMusic.get_history
|
.. automethod:: YTMusic.get_history
|
||||||
.. automethod:: YTMusic.rate_song
|
.. automethod:: YTMusic.rate_song
|
||||||
|
|
||||||
|
Playlists
|
||||||
|
---------
|
||||||
|
.. automethod:: YTMusic.get_playlists
|
||||||
.. automethod:: YTMusic.get_playlist_items
|
.. automethod:: YTMusic.get_playlist_items
|
||||||
.. automethod:: YTMusic.create_playlist
|
.. automethod:: YTMusic.create_playlist
|
||||||
.. automethod:: YTMusic.edit_playlist
|
.. automethod:: YTMusic.edit_playlist
|
||||||
.. automethod:: YTMusic.delete_playlist
|
.. automethod:: YTMusic.delete_playlist
|
||||||
.. automethod:: YTMusic.add_playlist_items
|
.. automethod:: YTMusic.add_playlist_items
|
||||||
.. automethod:: YTMusic.remove_playlist_items
|
.. automethod:: YTMusic.remove_playlist_items
|
||||||
|
|
||||||
|
Uploads
|
||||||
|
-------
|
||||||
|
.. automethod:: YTMusic.get_uploaded_songs
|
||||||
|
.. automethod:: YTMusic.upload_song
|
||||||
|
.. automethod:: YTMusic.delete_uploaded_song
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
Usage
|
Usage
|
||||||
=======
|
=======
|
||||||
|
|
||||||
**Unauthenticated** requests for retrieving playlist content or searching:
|
Unauthenticated
|
||||||
|
---------------
|
||||||
|
Unauthenticated requests for retrieving playlist content or searching:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
@ -13,24 +15,22 @@ Usage
|
||||||
If an endpoint requires authentication you will receive an error:
|
If an endpoint requires authentication you will receive an error:
|
||||||
``Please provide authentication before using this function``
|
``Please provide authentication before using this function``
|
||||||
|
|
||||||
|
Authenticated
|
||||||
|
-------------
|
||||||
For authenticated requests you need to set up your credentials first: :doc:`Setup <setup>`
|
For authenticated requests you need to set up your credentials first: :doc:`Setup <setup>`
|
||||||
|
|
||||||
**Authenticated** request to interact with your playlist:
|
After you have created the authentication JSON, you can instantiate the class:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from ytmusicapi import YTMusic
|
from ytmusicapi import YTMusic
|
||||||
|
|
||||||
ytmusic = YTMusic('headers_auth.json')
|
ytmusic = YTMusic('headers_auth.json')
|
||||||
|
|
||||||
|
|
||||||
Detailed example with authenticated requests:
|
With the :code:`ytmusic` instance you can now perform authenticated requests:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from ytmusicapi import YTMusic
|
|
||||||
|
|
||||||
ytmusic = YTMusic('headers_auth.json')
|
|
||||||
playlistId = ytmusic.create_playlist("test", "test description")
|
playlistId = ytmusic.create_playlist("test", "test description")
|
||||||
search_results = ytmusic.search("Oasis Wonderwall")
|
search_results = ytmusic.search("Oasis Wonderwall")
|
||||||
ytmusic.add_playlist_items(playlistId, [search_results[0]['videoId'])
|
ytmusic.add_playlist_items(playlistId, [search_results[0]['videoId'])
|
||||||
Loading…
Reference in a new issue