add: set_album_save as a convenience/alias/findable method for album rate_playlist
This commit is contained in:
parent
b2c078df63
commit
b60af9cc25
2 changed files with 26 additions and 0 deletions
|
|
@ -417,6 +417,13 @@ class TestYTMusic(unittest.TestCase):
|
|||
"INDIFFERENT")
|
||||
self.assertIn("actions", response)
|
||||
|
||||
def test_save_album(self):
|
||||
response = self.yt_auth.set_album_save("OLAK5uy_kCxQGgn8Ayb-8VNSs3Ok7qdcKe5PJy6ZQ")
|
||||
self.assertIn("actions", response)
|
||||
response = self.yt_auth.set_album_save("OLAK5uy_kCxQGgn8Ayb-8VNSs3Ok7qdcKe5PJy6ZQ",
|
||||
saved=False)
|
||||
self.assertIn("actions", response)
|
||||
|
||||
def test_subscribe_artists(self):
|
||||
self.yt_auth.subscribe_artists(["UCUDVBtnOQi4c7E8jebpjc9Q", "UCiMhD4jzUqG-IgPzUmmytRQ"])
|
||||
self.yt_auth.unsubscribe_artists(["UCUDVBtnOQi4c7E8jebpjc9Q", "UCiMhD4jzUqG-IgPzUmmytRQ"])
|
||||
|
|
|
|||
|
|
@ -267,6 +267,25 @@ class LibraryMixin:
|
|||
|
||||
return self._send_request(endpoint, body)
|
||||
|
||||
def set_album_save(self, audioPlaylistId: str, saved=True):
|
||||
"""
|
||||
Edit the save status of an album in the user's library. Findable convenience/alias
|
||||
method for album portion of rate_playlist.
|
||||
|
||||
:param audioPlaylistId: audioPlaylistId (starts with "OLAKuy_") for the target album
|
||||
:param saved: Boolean. The resulting saved state of the album. (Default = True)
|
||||
|
||||
:return: Full response
|
||||
"""
|
||||
|
||||
self._check_auth()
|
||||
body = {'target': {'playlistId': audioPlaylistId}}
|
||||
endpoint = prepare_like_endpoint('LIKE' if saved else 'INDIFFERENT')
|
||||
if endpoint is None:
|
||||
return
|
||||
|
||||
return self._send_request(endpoint, body)
|
||||
|
||||
def edit_song_library_status(self, feedbackTokens: List[str] = None) -> Dict:
|
||||
"""
|
||||
Adds or removes a song from your library depending on the token provided.
|
||||
|
|
|
|||
Loading…
Reference in a new issue