remove browse endpoint request keys that are no longer used

This commit is contained in:
sigma67 2021-10-28 21:58:52 +02:00
commit 72661fe1ff
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
4 changed files with 5 additions and 16 deletions

View file

@ -9,17 +9,6 @@ import locale
from ytmusicapi.constants import * from ytmusicapi.constants import *
def prepare_browse_endpoint(type, browseId):
return {
'browseEndpointContextSupportedConfigs': {
"browseEndpointContextMusicConfig": {
"pageType": "MUSIC_PAGE_TYPE_" + type
}
},
'browseId': browseId
}
def prepare_like_endpoint(rating): def prepare_like_endpoint(rating):
if rating == 'LIKE': if rating == 'LIKE':
return 'like/like' return 'like/like'

View file

@ -275,7 +275,7 @@ class BrowsingMixin:
""" """
if channelId.startswith("MPLA"): if channelId.startswith("MPLA"):
channelId = channelId[4:] channelId = channelId[4:]
body = prepare_browse_endpoint("ARTIST", channelId) body = {'browseId': channelId}
endpoint = 'browse' endpoint = 'browse'
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST) results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)
@ -461,7 +461,7 @@ class BrowsingMixin:
] ]
} }
""" """
body = prepare_browse_endpoint("ALBUM", browseId) body = {'browseId': browseId}
endpoint = 'browse' endpoint = 'browse'
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
album = {} album = {}

View file

@ -61,7 +61,7 @@ class PlaylistsMixin:
needed for moving/removing playlist items needed for moving/removing playlist items
""" """
browseId = "VL" + playlistId if not playlistId.startswith("VL") else playlistId browseId = "VL" + playlistId if not playlistId.startswith("VL") else playlistId
body = prepare_browse_endpoint("PLAYLIST", browseId) body = {'browseId': browseId}
endpoint = 'browse' endpoint = 'browse'
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
results = nav(response, results = nav(response,

View file

@ -126,7 +126,7 @@ class UploadsMixin:
] ]
""" """
self._check_auth() self._check_auth()
body = prepare_browse_endpoint("ARTIST", browseId) body = {'browseId': browseId}
endpoint = 'browse' endpoint = 'browse'
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + MUSIC_SHELF) results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + MUSIC_SHELF)
@ -177,7 +177,7 @@ class UploadsMixin:
}, },
""" """
self._check_auth() self._check_auth()
body = prepare_browse_endpoint("ALBUM", browseId) body = {'browseId': browseId}
endpoint = 'browse' endpoint = 'browse'
response = self._send_request(endpoint, body) response = self._send_request(endpoint, body)
album = parse_album_header(response) album = parse_album_header(response)