diff --git a/ytmusicapi/navigation.py b/ytmusicapi/navigation.py index f8c105c..226747c 100644 --- a/ytmusicapi/navigation.py +++ b/ytmusicapi/navigation.py @@ -26,6 +26,8 @@ ] WATCH_VIDEO_ID = ['watchEndpoint', 'videoId'] NAVIGATION_VIDEO_ID = ['navigationEndpoint'] + WATCH_VIDEO_ID +QUEUE_VIDEO_ID = ['queueAddEndpoint','queueTarget','videoId'] +NAVIGATION_VIDEO_ID_2 = MENU_ITEMS+[0]+MENU_SERVICE+QUEUE_VIDEO_ID NAVIGATION_PLAYLIST_ID = ['navigationEndpoint', 'watchEndpoint', 'playlistId'] NAVIGATION_WATCH_PLAYLIST_ID = ['navigationEndpoint', 'watchPlaylistEndpoint', 'playlistId'] NAVIGATION_VIDEO_TYPE = [ diff --git a/ytmusicapi/parsers/browsing.py b/ytmusicapi/parsers/browsing.py index c221cd9..56d9ce7 100644 --- a/ytmusicapi/parsers/browsing.py +++ b/ytmusicapi/parsers/browsing.py @@ -103,9 +103,12 @@ def parse_song_flat(data): def parse_video(result): runs = nav(result, SUBTITLE_RUNS) artists_len = get_dot_separator_index(runs) + videoId = nav(result, NAVIGATION_VIDEO_ID, True) + if not videoId: + videoId = nav(result, NAVIGATION_VIDEO_ID_2) return { 'title': nav(result, TITLE_TEXT), - 'videoId': nav(result, NAVIGATION_VIDEO_ID), + 'videoId': videoId, 'artists': parse_song_artists_runs(runs[:artists_len]), 'playlistId': nav(result, NAVIGATION_PLAYLIST_ID, True), 'thumbnails': nav(result, THUMBNAIL_RENDERER, True),