Invidious is an alternative front-end to YouTube
fix cases when high offset video from playlist has no offset in url
diogo440105976f20
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.crindex 771f5ba1..33623ec2 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)elsevideos = [] of PlaylistVideo- until videos.size >= 50 || videos.size == playlist.video_count+ until videos.size >= 50 || videos.size == playlist.video_count || offset >= playlist.video_countif offset >= 100# Normalize offset to match youtube's behavior (100 videos chunck per request)normalized_offset = (offset / 100).to_i64 * 100_i64@@ -454,18 +454,24 @@ def get_playlist_videos(db, playlist, offset, locale = nil, continuation = nil)if continuationuntil videos[0].id == continuationvideos.shift+ if videos.size == 0+ break+ endend- elsif+ elseuntil videos[0].index == offsetvideos.shift+ if videos.size == 0+ break+ endendend- if offset == 0+ if videos.size > 0 && offset == 0offset = videos[0].indexend- offset += 50+ offset += 100endreturn videos