From e3df9f9eaddfa8eb4781512de7d4fd97d1729b10 Mon Sep 17 00:00:00 2001 From: diogo Date: Mon, 19 Jul 2021 17:21:04 +0300 Subject: [PATCH] use dig for getting the video index --- src/invidious/playlists.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index a290ca61..788a4dbc 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -439,7 +439,7 @@ def get_playlist_videos(db, playlist, offset, locale = nil, continuation = nil) else if continuation initial_data = request_youtube_api_next(continuation, playlist.id) - offset = initial_data["contents"]["twoColumnWatchNextResults"]["playlist"]["playlist"]["currentIndex"].as_i + offset = initial_data.dig?("contents", "twoColumnWatchNextResults", "playlist", "playlist", "currentIndex").try &.as_i || offset end videos = [] of PlaylistVideo