Fix playlist_index's inconsistent behavior #302
Merged
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.
There are some inconsistencies in how youtube-dl and yt-dlp handles
playlist_indexwhen used with--playlist-reverseand similar options. Sometimesplaylist_indexis the index of the item in the actual playlist, and sometimes, it is the position of the item in the download queue, sometimes neither...1. Normal use, we get expected results (
1-10)2. When using
--playlist-start 5, we get5-10which is the actual index in the playlist3. When using
--playlist-reverse, we get1-10which is the queue position. The index in actual playlist would have given10-14.
--playlist-items 10,9,8,7,6,5,4,3,2,1. While the download queue for this is the same as (3), we get the index in actual playlist10-1since we didn't use--playlist-reverse5. When using both
--playlist-start 5and--playlist-reversetogether, he index in the playlist are10-5and position in queue is1-5. But we get5-10which is neither...To fix this inconsistency, I am making
playlist_indexalways the position of the video in the actual playlist and adding a new fieldplaylist_autonumberwhich is the position of the item in the playlist queue.Outputs with this PR