Allow batch playlist item processing: add_playlist_items, remove_playlist_items
Include default search without filter Remove body from class instance to avoid pollution from previous calls
This commit is contained in:
parent
790c6187a1
commit
9ef92f866c
3 changed files with 138 additions and 91 deletions
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.3.0"
|
__version__ = "0.4.0"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ def parse_songs(results):
|
||||||
continue
|
continue
|
||||||
data = result['musicResponsiveListItemRenderer']
|
data = result['musicResponsiveListItemRenderer']
|
||||||
try:
|
try:
|
||||||
# if item is not playable, there is not videoId
|
# if item is not playable, there is no videoId
|
||||||
if 'playNavigationEndpoint' in data['overlay']['musicItemThumbnailOverlayRenderer']['content']['musicPlayButtonRenderer']:
|
if 'playNavigationEndpoint' in data['overlay']['musicItemThumbnailOverlayRenderer']['content']['musicPlayButtonRenderer']:
|
||||||
videoId = data['overlay']['musicItemThumbnailOverlayRenderer']['content']['musicPlayButtonRenderer']['playNavigationEndpoint']['watchEndpoint']['videoId']
|
videoId = data['overlay']['musicItemThumbnailOverlayRenderer']['content']['musicPlayButtonRenderer']['playNavigationEndpoint']['watchEndpoint']['videoId']
|
||||||
else:
|
else:
|
||||||
|
|
@ -27,5 +27,44 @@ def parse_songs(results):
|
||||||
|
|
||||||
return songs
|
return songs
|
||||||
|
|
||||||
|
|
||||||
|
def parse_search_result(data, resultType = None):
|
||||||
|
search_result = {}
|
||||||
|
default = not resultType
|
||||||
|
if not resultType:
|
||||||
|
resultType = get_item_text(data, 1).lower()
|
||||||
|
# default to album since it's labeled with multiple values ('Single', 'EP', etc.)
|
||||||
|
if resultType not in ['artist', 'playlist', 'song', 'video']:
|
||||||
|
resultType = 'album'
|
||||||
|
|
||||||
|
if resultType in ['artist', 'album', 'playlist']:
|
||||||
|
search_result['browseId'] = data['navigationEndpoint']['browseEndpoint']['browseId']
|
||||||
|
|
||||||
|
if resultType in ['artist']:
|
||||||
|
search_result['artist'] = get_item_text(data, 0)
|
||||||
|
|
||||||
|
elif resultType in ['album']:
|
||||||
|
search_result['title'] = get_item_text(data, 0)
|
||||||
|
search_result['type'] = get_item_text(data, 1)
|
||||||
|
search_result['artist'] = get_item_text(data, 2)
|
||||||
|
search_result['year'] = get_item_text(data, 3)
|
||||||
|
|
||||||
|
elif resultType in ['playlist']:
|
||||||
|
search_result['title'] = get_item_text(data, 0)
|
||||||
|
search_result['author'] = get_item_text(data, 1 + default)
|
||||||
|
search_result['itemCount'] = get_item_text(data, 2 + default).split(' ')[0]
|
||||||
|
|
||||||
|
# songs, videos
|
||||||
|
elif resultType in ['song', 'video']:
|
||||||
|
search_result['videoId'] = data['overlay']['musicItemThumbnailOverlayRenderer']['content'][
|
||||||
|
'musicPlayButtonRenderer']['playNavigationEndpoint']['watchEndpoint']['videoId']
|
||||||
|
search_result['title'] = get_item_text(data, 0)
|
||||||
|
search_result['artist'] = get_item_text(data, 1 + default)
|
||||||
|
|
||||||
|
search_result['resultType'] = resultType
|
||||||
|
|
||||||
|
return search_result
|
||||||
|
|
||||||
|
|
||||||
def get_item_text(item, index):
|
def get_item_text(item, index):
|
||||||
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][0]['text']
|
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][0]['text']
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
from ytmusicapi.helpers import parse_songs, get_item_text
|
from ytmusicapi.helpers import parse_songs, parse_search_result
|
||||||
|
|
||||||
params = '?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30'
|
params = '?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30'
|
||||||
base_url = 'https://music.youtube.com/youtubei/v1/'
|
base_url = 'https://music.youtube.com/youtubei/v1/'
|
||||||
|
|
@ -28,25 +28,29 @@ class YTMusic:
|
||||||
self.headers = json.load(json_file)
|
self.headers = json.load(json_file)
|
||||||
|
|
||||||
with open(pkg_resources.resource_filename('ytmusicapi', 'context.json')) as json_file:
|
with open(pkg_resources.resource_filename('ytmusicapi', 'context.json')) as json_file:
|
||||||
self.body = json.load(json_file)
|
self.context = json.load(json_file)
|
||||||
|
|
||||||
def __send_request(self, endpoint, additionalParams=""):
|
def __send_request(self, endpoint, body, additionalParams=""):
|
||||||
response = requests.post(base_url + endpoint + params + additionalParams, json=self.body, headers=self.headers)
|
body.update(self.context)
|
||||||
|
response = requests.post(base_url + endpoint + params + additionalParams, json=body, headers=self.headers)
|
||||||
return json.loads(response.text)
|
return json.loads(response.text)
|
||||||
|
|
||||||
def __check_auth(self):
|
def __check_auth(self):
|
||||||
if self.auth == "":
|
if self.auth == "":
|
||||||
raise Exception("Please provide authentication before using this function")
|
raise Exception("Please provide authentication before using this function")
|
||||||
|
|
||||||
def search(self, query, filter='songs'):
|
def search(self, query, filter=None):
|
||||||
"""
|
"""
|
||||||
Search YouTube music
|
Search YouTube music
|
||||||
Returns up to 20 results within the provided category.
|
Returns up to 20 results within the provided category.
|
||||||
By default only songs (audio-only) are returned
|
By default only songs (audio-only) are returned
|
||||||
|
|
||||||
:param query: Query string, i.e. 'Oasis Wonderwall'
|
:param query: Query string, i.e. 'Oasis Wonderwall'
|
||||||
:param filter: Filter for item types: 'songs', 'videos', 'albums', 'artists', 'playlists'
|
:param filter: Filter for item types. Allowed values:
|
||||||
|
'songs', 'videos', 'albums', 'artists', 'playlists'.
|
||||||
|
Default: Default search, including all types of items.
|
||||||
:return: List of results depending on filter.
|
:return: List of results depending on filter.
|
||||||
|
resultType specifies the type of item (important for default search).
|
||||||
albums, artists and playlists additionally contain a browseId, corresponding to
|
albums, artists and playlists additionally contain a browseId, corresponding to
|
||||||
albumId, channelId and playlistId (browseId='VL'+playlistId)
|
albumId, channelId and playlistId (browseId='VL'+playlistId)
|
||||||
|
|
||||||
|
|
@ -57,73 +61,61 @@ class YTMusic:
|
||||||
'videoId': 'ZrOKjDZOtkA',
|
'videoId': 'ZrOKjDZOtkA',
|
||||||
'artist': 'Oasis',
|
'artist': 'Oasis',
|
||||||
'title': 'Wonderwall (Remastered)',
|
'title': 'Wonderwall (Remastered)',
|
||||||
|
'resultType': 'song'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'videoId': 'Gvfgut8nAgw',
|
'videoId': 'Gvfgut8nAgw',
|
||||||
'artist': 'Oasis',
|
'artist': 'Oasis',
|
||||||
'title': 'Wonderwall',
|
'title': 'Wonderwall',
|
||||||
|
'resultType': 'song'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.body['query'] = query
|
body = {'query': query}
|
||||||
param1 = 'Eg-KAQwIA'
|
|
||||||
param3 = 'MABqChAEEAMQCRAFEAo%3D'
|
|
||||||
|
|
||||||
if filter == 'videos':
|
|
||||||
param2 = 'BABGAAgACgA'
|
|
||||||
elif filter == 'albums':
|
|
||||||
param2 = 'BAAGAEgACgA'
|
|
||||||
elif filter == 'artists':
|
|
||||||
param2 = 'BAAGAAgASgA'
|
|
||||||
elif filter == 'playlists':
|
|
||||||
param2 = 'BAAGAAgACgB'
|
|
||||||
else:
|
|
||||||
param2 = 'RAAGAAgACgA'
|
|
||||||
|
|
||||||
self.body['params'] = param1 + param2 + param3
|
|
||||||
|
|
||||||
endpoint = 'search'
|
endpoint = 'search'
|
||||||
search_results = []
|
search_results = []
|
||||||
|
|
||||||
|
if filter:
|
||||||
|
param1 = 'Eg-KAQwIA'
|
||||||
|
param3 = 'MABqChAEEAMQCRAFEAo%3D'
|
||||||
|
|
||||||
|
if filter == 'videos':
|
||||||
|
param2 = 'BABGAAgACgA'
|
||||||
|
elif filter == 'albums':
|
||||||
|
param2 = 'BAAGAEgACgA'
|
||||||
|
elif filter == 'artists':
|
||||||
|
param2 = 'BAAGAAgASgA'
|
||||||
|
elif filter == 'playlists':
|
||||||
|
param2 = 'BAAGAAgACgB'
|
||||||
|
else:
|
||||||
|
param2 = 'RAAGAAgACgA'
|
||||||
|
|
||||||
|
body['params'] = param1 + param2 + param3
|
||||||
|
|
||||||
|
elif filter not in ['albums', 'artists', 'playlists', 'songs', 'videos', None]:
|
||||||
|
return search_results
|
||||||
|
|
||||||
|
response = self.__send_request(endpoint, body)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self.__send_request(endpoint)
|
|
||||||
results = response['contents']['sectionListRenderer']['contents']
|
results = response['contents']['sectionListRenderer']['contents']
|
||||||
|
|
||||||
|
# no results
|
||||||
|
if len(results) == 1 and 'itemSectionRenderer' in results:
|
||||||
|
return search_results
|
||||||
|
|
||||||
for res in results:
|
for res in results:
|
||||||
if 'musicShelfRenderer' in res:
|
if 'musicShelfRenderer' in res:
|
||||||
results = res['musicShelfRenderer']['contents']
|
results = res['musicShelfRenderer']['contents']
|
||||||
break
|
|
||||||
|
|
||||||
for result in results:
|
for result in results:
|
||||||
data = result['musicResponsiveListItemRenderer']
|
data = result['musicResponsiveListItemRenderer']
|
||||||
# videoId
|
type = filter[:-1] if filter else None
|
||||||
search_result = {}
|
search_result = parse_search_result(data, type)
|
||||||
|
search_results.append(search_result)
|
||||||
|
|
||||||
if filter in ['artists', 'albums', 'playlists']:
|
|
||||||
search_result['browseId'] = data['navigationEndpoint']['browseEndpoint']['browseId']
|
|
||||||
search_result['pageType'] = data['navigationEndpoint']['browseEndpoint']['browseEndpointContextSupportedConfigs']['browseEndpointContextMusicConfig']['pageType']
|
|
||||||
|
|
||||||
if filter in ['artists']:
|
|
||||||
search_result['artist'] = get_item_text(data, 0)
|
|
||||||
|
|
||||||
elif filter in ['albums']:
|
|
||||||
search_result['title'] = get_item_text(data, 0)
|
|
||||||
search_result['type'] = get_item_text(data, 1)
|
|
||||||
search_result['artist'] = get_item_text(data, 2)
|
|
||||||
search_result['year'] = get_item_text(data, 3)
|
|
||||||
|
|
||||||
elif filter in ['playlists']:
|
|
||||||
search_result['title'] = get_item_text(data, 0)
|
|
||||||
search_result['author'] = get_item_text(data, 1)
|
|
||||||
search_result['itemCount'] = get_item_text(data, 2).split(' ')[0]
|
|
||||||
|
|
||||||
# songs, videos
|
|
||||||
else:
|
|
||||||
search_result['videoId'] = data['overlay']['musicItemThumbnailOverlayRenderer']['content']['musicPlayButtonRenderer']['playNavigationEndpoint']['watchEndpoint']['videoId']
|
|
||||||
search_result['title'] = get_item_text(data, 0)
|
|
||||||
search_result['artist'] = get_item_text(data, 1)
|
|
||||||
|
|
||||||
search_results.append(search_result)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
|
|
@ -144,9 +136,9 @@ class YTMusic:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['browseId'] = 'FEmusic_liked_playlists'
|
body = {'browseId': 'FEmusic_liked_playlists'}
|
||||||
endpoint = 'browse'
|
endpoint = 'browse'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content']['sectionListRenderer']['contents'][1]['itemSectionRenderer']['contents'][0]['gridRenderer']['items']
|
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content']['sectionListRenderer']['contents'][1]['itemSectionRenderer']['contents'][0]['gridRenderer']['items']
|
||||||
playlists = []
|
playlists = []
|
||||||
# skip first item ("New Playlist" button)
|
# skip first item ("New Playlist" button)
|
||||||
|
|
@ -175,9 +167,9 @@ class YTMusic:
|
||||||
The additional property 'played' indicates when the playlistItem was played
|
The additional property 'played' indicates when the playlistItem was played
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['browseId'] = 'FEmusic_history'
|
body = {'browseId': 'FEmusic_history'}
|
||||||
endpoint = 'browse'
|
endpoint = 'browse'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content'][
|
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content'][
|
||||||
'sectionListRenderer']['contents']
|
'sectionListRenderer']['contents']
|
||||||
songs = []
|
songs = []
|
||||||
|
|
@ -200,7 +192,7 @@ class YTMusic:
|
||||||
| 'INDIFFERENT' removes the previous rating and assigns no rating
|
| 'INDIFFERENT' removes the previous rating and assigns no rating
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['target'] = {'videoId': videoId}
|
body = {'target': {'videoId': videoId}}
|
||||||
if rating == 'LIKE':
|
if rating == 'LIKE':
|
||||||
endpoint = 'like/like'
|
endpoint = 'like/like'
|
||||||
elif rating == 'DISLIKE':
|
elif rating == 'DISLIKE':
|
||||||
|
|
@ -210,7 +202,7 @@ class YTMusic:
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.__send_request(endpoint)
|
self.__send_request(endpoint, body)
|
||||||
|
|
||||||
|
|
||||||
def get_playlist_items(self, playlistId, limit=1000):
|
def get_playlist_items(self, playlistId, limit=1000):
|
||||||
|
|
@ -234,10 +226,17 @@ class YTMusic:
|
||||||
needed for moving/removing playlist items
|
needed for moving/removing playlist items
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.body['browseEndpointContextSupportedConfigs'] = {"browseEndpointContextMusicConfig": {"pageType": "MUSIC_PAGE_TYPE_PLAYLIST"}}
|
body = { 'browseEndpointContextSupportedConfigs':
|
||||||
self.body['browseId'] = "VL" + playlistId
|
{
|
||||||
|
"browseEndpointContextMusicConfig":
|
||||||
|
{
|
||||||
|
"pageType": "MUSIC_PAGE_TYPE_PLAYLIST"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'browseId': "VL" + playlistId
|
||||||
|
}
|
||||||
endpoint = 'browse'
|
endpoint = 'browse'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content']['sectionListRenderer']['contents'][0]['musicPlaylistShelfRenderer']
|
results = response['contents']['singleColumnBrowseResultsRenderer']['tabs'][0]['tabRenderer']['content']['sectionListRenderer']['contents'][0]['musicPlaylistShelfRenderer']
|
||||||
songs = []
|
songs = []
|
||||||
if 'musicDetailHeaderRenderer' in response['header']: #playlist not owned
|
if 'musicDetailHeaderRenderer' in response['header']: #playlist not owned
|
||||||
|
|
@ -254,7 +253,7 @@ class YTMusic:
|
||||||
print("requested from " + str(request_count * 100))
|
print("requested from " + str(request_count * 100))
|
||||||
additionalParams = "&ctoken=" + ctoken + "&continuation=" + ctoken
|
additionalParams = "&ctoken=" + ctoken + "&continuation=" + ctoken
|
||||||
|
|
||||||
response = self.__send_request(endpoint, additionalParams)
|
response = self.__send_request(endpoint, body, additionalParams)
|
||||||
results = response['continuationContents']['musicPlaylistShelfContinuation']
|
results = response['continuationContents']['musicPlaylistShelfContinuation']
|
||||||
songs.extend(parse_songs(results['contents']))
|
songs.extend(parse_songs(results['contents']))
|
||||||
request_count += 1
|
request_count += 1
|
||||||
|
|
@ -271,11 +270,9 @@ class YTMusic:
|
||||||
:return: ID of the YouTube playlist
|
:return: ID of the YouTube playlist
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['title'] = title
|
body = {'title': title, 'description': description, 'privacyStatus': privacy_status}
|
||||||
self.body['description'] = description
|
|
||||||
self.body['privacyStatus'] = privacy_status
|
|
||||||
endpoint = 'playlist/create'
|
endpoint = 'playlist/create'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
return response['playlistId']
|
return response['playlistId']
|
||||||
|
|
||||||
def edit_playlist(self, playlistId, title=None, description=None, privacyStatus=None):
|
def edit_playlist(self, playlistId, title=None, description=None, privacyStatus=None):
|
||||||
|
|
@ -289,7 +286,7 @@ class YTMusic:
|
||||||
:return: Status String or full response
|
:return: Status String or full response
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['playlistId'] = playlistId
|
body = {'playlistId': playlistId}
|
||||||
actions = []
|
actions = []
|
||||||
if title:
|
if title:
|
||||||
actions.append({'action': 'ACTION_SET_PLAYLIST_NAME', 'playlistName': title})
|
actions.append({'action': 'ACTION_SET_PLAYLIST_NAME', 'playlistName': title})
|
||||||
|
|
@ -300,9 +297,9 @@ class YTMusic:
|
||||||
if privacyStatus:
|
if privacyStatus:
|
||||||
actions.append({'action': 'ACTION_SET_PLAYLIST_PRIVACY', 'playlistPrivacy': privacyStatus})
|
actions.append({'action': 'ACTION_SET_PLAYLIST_PRIVACY', 'playlistPrivacy': privacyStatus})
|
||||||
|
|
||||||
self.body['actions'] = actions
|
body['actions'] = actions
|
||||||
endpoint = 'browse/edit_playlist'
|
endpoint = 'browse/edit_playlist'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
return response['status'] if 'status' in response else response
|
return response['status'] if 'status' in response else response
|
||||||
|
|
||||||
def delete_playlist(self, playlistId):
|
def delete_playlist(self, playlistId):
|
||||||
|
|
@ -313,41 +310,52 @@ class YTMusic:
|
||||||
:return: Status String or full response
|
:return: Status String or full response
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['playlistId'] = playlistId
|
body = {'playlistId': playlistId}
|
||||||
endpoint = 'playlist/delete'
|
endpoint = 'playlist/delete'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
return response['status'] if 'status' in response else response
|
return response['status'] if 'status' in response else response
|
||||||
|
|
||||||
def add_playlist_item(self, playlistId, videoId):
|
def add_playlist_items(self, playlistId, videoIds):
|
||||||
"""
|
"""
|
||||||
Add a song to an existing playlist
|
Add songs to an existing playlist
|
||||||
|
|
||||||
:param playlistId: Playlist id
|
:param playlistId: Playlist id
|
||||||
:param videoId: Video id
|
:param videoIds: List of Video ids
|
||||||
:return: Status String or full response
|
:return: Status String or full response
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
self.body['playlistId'] = playlistId
|
body = {'playlistId': playlistId, 'actions': []}
|
||||||
self.body['actions'] = {'action': 'ACTION_ADD_VIDEO', 'addedVideoId': videoId}
|
for videoId in videoIds:
|
||||||
|
body['actions'].append({
|
||||||
|
'action': 'ACTION_ADD_VIDEO',
|
||||||
|
'addedVideoId': videoId
|
||||||
|
})
|
||||||
|
|
||||||
endpoint = 'browse/edit_playlist'
|
endpoint = 'browse/edit_playlist'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
return response['status'] if 'status' in response else response
|
return response['status'] if 'status' in response else response
|
||||||
|
|
||||||
def remove_playlist_item(self, playlistId, song):
|
def remove_playlist_items(self, playlistId, videos):
|
||||||
"""
|
"""
|
||||||
Remove a song from an existing playlist
|
Remove songs from an existing playlist
|
||||||
|
|
||||||
:param playlistId: Playlist id
|
:param playlistId: Playlist id
|
||||||
:param song: Dictionary containing song information. Must contain videoId and setVideoId
|
:param videos: List of Dictionaries containing video information. Must contain videoId and setVideoId
|
||||||
:return: Status String or full response
|
:return: Status String or full response
|
||||||
"""
|
"""
|
||||||
self.__check_auth()
|
self.__check_auth()
|
||||||
if not song['setVideoId']:
|
if not videos[0]['setVideoId']:
|
||||||
print("Cannot remove this song, since you don't own this playlist.")
|
print("Cannot remove songs, because setVideoId is missing. Do you own this playlist?")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
body = {'playlistId': playlistId, 'actions': []}
|
||||||
|
for video in videos:
|
||||||
|
body['actions'].append({
|
||||||
|
'setVideoId': video['setVideoId'],
|
||||||
|
'removedVideoId': video['videoId'],
|
||||||
|
'action': 'ACTION_REMOVE_VIDEO'
|
||||||
|
})
|
||||||
|
|
||||||
self.body['playlistId'] = playlistId
|
|
||||||
self.body['actions'] = { 'setVideoId': song['setVideoId'], 'removedVideoId': song['videoId'], 'action': 'ACTION_REMOVE_VIDEO'}
|
|
||||||
endpoint = 'browse/edit_playlist'
|
endpoint = 'browse/edit_playlist'
|
||||||
response = self.__send_request(endpoint)
|
response = self.__send_request(endpoint, body)
|
||||||
return response['status'] if 'status' in response else response
|
return response['status'] if 'status' in response else response
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue