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_index
when used with--playlist-reverse
and similar options. Sometimesplaylist_index
is 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-10
which is the actual index in the playlist3. When using
--playlist-reverse
, we get1-10
which is the queue position. The index in actual playlist would have given10-1
4.
--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-1
since we didn't use--playlist-reverse
5. When using both
--playlist-start 5
and--playlist-reverse
together, he index in the playlist are10-5
and position in queue is1-5
. But we get5-10
which is neither...To fix this inconsistency, I am making
playlist_index
always the position of the video in the actual playlist and adding a new fieldplaylist_autonumber
which is the position of the item in the playlist queue.Outputs with this PR