diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2021-03-18 23:11:46 +0000 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2021-03-21 00:15:39 +0100 |
| commit | fec82df4516c48e27ef12ed7e48faf7e9590d332 (patch) | |
| tree | d0a43add9229273eb104c7d93cdd183dbd68ff15 /src | |
| parent | 3286328de4cd64b48265b42333bfa67346b7a0b9 (diff) | |
| download | invidious-fec82df4516c48e27ef12ed7e48faf7e9590d332.tar.gz invidious-fec82df4516c48e27ef12ed7e48faf7e9590d332.tar.bz2 invidious-fec82df4516c48e27ef12ed7e48faf7e9590d332.zip | |
Fix fetching of large playlist
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/playlists.cr | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 0251a69c..feaed6de 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -441,17 +441,8 @@ 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 - return [] of PlaylistVideo - else # Extract first page of videos - response = YT_POOL.client &.get("/playlist?list=#{plid}&gl=US&hl=en") - initial_data = extract_initial_data(response.body) - end + response = YT_POOL.client &.get("/playlist?list=#{plid}&gl=US&hl=en") + initial_data = extract_initial_data(response.body) return [] of PlaylistVideo if !initial_data videos = extract_playlist_videos(initial_data) |
