Update docs
This commit is contained in:
parent
5d9b44f721
commit
f7761a0e49
2 changed files with 30 additions and 9 deletions
|
|
@ -1,7 +1,9 @@
|
|||
Usage
|
||||
=======
|
||||
|
||||
**Unauthenticated** requests for retrieving playlist content or searching:
|
||||
Unauthenticated
|
||||
---------------
|
||||
Unauthenticated requests for retrieving playlist content or searching:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
@ -13,24 +15,22 @@ Usage
|
|||
If an endpoint requires authentication you will receive an error:
|
||||
``Please provide authentication before using this function``
|
||||
|
||||
Authenticated
|
||||
-------------
|
||||
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
|
||||
|
||||
from ytmusicapi import YTMusic
|
||||
|
||||
ytmusic = YTMusic('headers_auth.json')
|
||||
|
||||
|
||||
Detailed example with authenticated requests:
|
||||
With the :code:`ytmusic` instance you can now perform authenticated requests:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from ytmusicapi import YTMusic
|
||||
|
||||
ytmusic = YTMusic('headers_auth.json')
|
||||
playlistId = ytmusic.create_playlist("test", "test description")
|
||||
search_results = ytmusic.search("Oasis Wonderwall")
|
||||
ytmusic.add_playlist_items(playlistId, [search_results[0]['videoId'])
|
||||
Loading…
Reference in a new issue