From 9b5e3e96f3c78a885d9e5cfde9d1e63a20f89d57 Mon Sep 17 00:00:00 2001 From: Andrew Zhao Date: Thu, 18 Mar 2021 14:00:47 -0400 Subject: [PATCH] fix larger playlists --- src/invidious/playlists.cr | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 0251a69c..39a7906a 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -441,12 +441,7 @@ def fetch_playlist_videos(plid, video_count, offset = 0, locale = nil, continuat offset = initial_data["currentVideoEndpoint"]?.try &.["watchEndpoint"]?.try &.["index"]?.try &.as_i64 || offset end - if video_count > 100 - url = produce_playlist_url(plid, offset) - - response = YT_POOL.client &.get(url) - initial_data = JSON.parse(response.body).as_a.find(&.as_h.["response"]?).try &.as_h - elsif offset > 100 + if offset > 100 return [] of PlaylistVideo else # Extract first page of videos response = YT_POOL.client &.get("/playlist?list=#{plid}&gl=US&hl=en")