fix get_watch_playlist results if only videoid is provided
This commit is contained in:
parent
ef842d4d65
commit
71b64796da
1 changed files with 7 additions and 5 deletions
|
|
@ -48,19 +48,21 @@ class WatchMixin:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
body = {'enablePersistentPlaylistPanel': True, 'isAudioOnly': True}
|
body = {'enablePersistentPlaylistPanel': True, 'isAudioOnly': True}
|
||||||
|
if not videoId and not playlistId:
|
||||||
|
raise Exception("You must provide either a video id, a playlist id, or both")
|
||||||
if videoId:
|
if videoId:
|
||||||
body['videoId'] = videoId
|
body['videoId'] = videoId
|
||||||
|
if not playlistId:
|
||||||
|
playlistId = "RDAMVM" + videoId
|
||||||
if not params:
|
if not params:
|
||||||
body['watchEndpointMusicSupportedConfigs'] = {
|
body['watchEndpointMusicSupportedConfigs'] = {
|
||||||
'watchEndpointMusicConfig': {
|
'watchEndpointMusicConfig': {
|
||||||
'hasPersistentPlaylistPanel': True,
|
'hasPersistentPlaylistPanel': True,
|
||||||
'musicVideoType': "MUSIC_VIDEO_TYPE_OMV",
|
'musicVideoType': "MUSIC_VIDEO_TYPE_ATV",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_playlist = False
|
body['playlistId'] = validate_playlist_id(playlistId)
|
||||||
if playlistId:
|
is_playlist = body['playlistId'].startswith('PL')
|
||||||
body['playlistId'] = validate_playlist_id(playlistId)
|
|
||||||
is_playlist = body['playlistId'].startswith('PL')
|
|
||||||
if params:
|
if params:
|
||||||
body['params'] = params
|
body['params'] = params
|
||||||
endpoint = 'next'
|
endpoint = 'next'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue