fix: YouTube autoplay fails after track #400 (#3541)#3584
Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom Feb 1, 2026
Merged
Conversation
Member
|
thank you so much! @suryaprakash0010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: YouTube Autoplay Fails After Track 400
๐ฏ Issue Summary
Fixes #3541 - YouTube fails to autoplay next track for all tracks past 400 in large playlists.
๐ Root Cause
The
playlistUpNextAutoplayfunction was incorrectly settingcurrentIndex = totalVideoswhenplaylist_up_next_autoplaywas disabled, forcing playlists to end and breaking autoplay for large playlists beyond YouTube's ~200 video pagination limit.๐ ๏ธ Solution
Core Fix
currentIndex = totalVideoscurrentIndexandlocalCurrentIndexto maintain playlist continuityEnhanced Features
๐ Files Changed
๐
js&css\web-accessible\www.youtube.com\playlist.jsplaylistUpNextAutoplay()logicplaylistLargePlaylistHandler()functioncleanupPlaylistHandlers()function๐
js&css\web-accessible\functions.jsvideoPageUpdate()๐
js&css\web-accessible\init.jsyt-page-data-updatedyt-navigate-finishfor navigation๐งช
test-large-playlist-fix.js(New)๐ How It Works
๐งช Testing
Automated Test
Manual Testing
โ Verification
๐ Impact
๐ Result
Users can now autoplay through large playlists without interruption after track 400, resolving the long-standing issue reported in #3541.