Add remaining methods to documentation
This commit is contained in:
parent
53b4e0bde3
commit
6dc8ac65e4
2 changed files with 20 additions and 2 deletions
|
|
@ -8,7 +8,12 @@ Reference for the YTMusic class.
|
||||||
.. currentmodule:: ytmusicapi
|
.. currentmodule:: ytmusicapi
|
||||||
.. autoclass:: YTMusic
|
.. autoclass:: YTMusic
|
||||||
.. automethod:: YTMusic.__init__
|
.. automethod:: YTMusic.__init__
|
||||||
|
.. automethod:: YTMusic.search
|
||||||
.. automethod:: YTMusic.get_playlists
|
.. automethod:: YTMusic.get_playlists
|
||||||
|
.. automethod:: YTMusic.get_liked_songs
|
||||||
.. 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.add_playlist_item
|
||||||
|
.. automethod:: YTMusic.remove_playlist_item
|
||||||
|
|
@ -8,6 +8,11 @@ base_url = 'https://music.youtube.com/youtubei/v1/'
|
||||||
|
|
||||||
|
|
||||||
class YTMusic:
|
class YTMusic:
|
||||||
|
"""
|
||||||
|
Allows automated interactions with YouTube Music by emulating the YouTube web client's requests.
|
||||||
|
Permits both authenticated and non-authenticated requests.
|
||||||
|
Authentication header data must be provided on initialization.
|
||||||
|
"""
|
||||||
def __init__(self, auth=""):
|
def __init__(self, auth=""):
|
||||||
"""
|
"""
|
||||||
Create a new instance to interact with YouTube Music.
|
Create a new instance to interact with YouTube Music.
|
||||||
|
|
@ -36,10 +41,11 @@ class YTMusic:
|
||||||
def search(self, query):
|
def search(self, query):
|
||||||
"""
|
"""
|
||||||
Search for any song within YouTube music
|
Search for any song within YouTube music
|
||||||
|
|
||||||
:param query: Query string, i.e. 'Oasis Wonderwall'
|
:param query: Query string, i.e. 'Oasis Wonderwall'
|
||||||
:return: List of song results
|
:return: List of song results
|
||||||
|
|
||||||
Example list:
|
Example list::
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
@ -54,6 +60,7 @@ class YTMusic:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.body['query'] = query
|
self.body['query'] = query
|
||||||
self.body['params'] = 'Eg-KAQwIARAAGAAgACgAMABqChAEEAMQCRAFEAo%3D'
|
self.body['params'] = 'Eg-KAQwIARAAGAAgACgAMABqChAEEAMQCRAFEAo%3D'
|
||||||
|
|
@ -110,6 +117,12 @@ class YTMusic:
|
||||||
return playlists
|
return playlists
|
||||||
|
|
||||||
def get_liked_songs(self, limit=1000):
|
def get_liked_songs(self, limit=1000):
|
||||||
|
"""
|
||||||
|
Gets playlist items for the 'Liked Songs' playlist
|
||||||
|
|
||||||
|
:param limit: How many items to return. Default: 1000
|
||||||
|
:return: List of playlistItem dictionaries. See :py:func:`get_playlist_items`
|
||||||
|
"""
|
||||||
return self.get_playlist_items('LM', limit)
|
return self.get_playlist_items('LM', limit)
|
||||||
|
|
||||||
def get_history(self):
|
def get_history(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue