How to refresh index when downloading a playlist ? #22533

Open
opened 2026-02-21 12:20:45 -05:00 by deekerman · 0 comments
Owner

Originally created by @fallais on GitHub (Jan 5, 2021).

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

I am using youtube-dl to download a playlist in order to have a local copy of it. At this point, everything is clear and working.
I format the output by using the playlist_index, example :

001 - Great Song.mp3
002 - Fabulous Song.mp3
003 - Super Song.mp3

I scheduled youtube-dl to run everyday with CRON.
This is when the issue occurs, if I add a new video to the playlist during two CRON occurences, the files listing ends up like this :

001 - Great Song.mp3
001 - Fantastic Song.mp3
002 - Fabulous Song.mp3
003 - Super Song.mp3

The index is being duplicated, and is becoming useless. It would need to have a custom script to rename all files, but it is a bit tricky as it would need to decide which file is newer, but using the modification time can be wrong. It could be as worse as the number of new videos increases... for example :

001 - Great Song.mp3
001 - Fantastic Song.mp3
002 - Fabulous Song.mp3
002 - OMG Song.mp3
003 - Super Song.mp3
003 - Magic Song.mp3
004 - Example Song.mp3
005 - ...
006 - ...
007 - ...
008 - ...

The solution would be to add an option to youtube-dl to rename all the files when downloading a playlist.

This use case can be see and named as a playlist rsync tool. The rsync notion does not seem to be possible actually.

Note : I searched in the closed issue and something might be similar but closed for no reason (https://github.com/ytdl-org/youtube-dl/issues/27052)

Originally created by @fallais on GitHub (Jan 5, 2021). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions - Search the bugtracker for similar questions: http://yt-dl.org/search-issues - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm asking a question - [x] I've looked through the README and FAQ for similar questions - [x] I've searched the bugtracker for similar questions including closed ones ## Question I am using _youtube-dl_ to download a playlist in order to have a local copy of it. At this point, everything is clear and working. I format the output by using the **playlist_index**, example : 001 - Great Song.mp3 002 - Fabulous Song.mp3 003 - Super Song.mp3 I scheduled _youtube-dl_ to run everyday with CRON. This is when the issue occurs, if I add a new video to the playlist during two CRON occurences, the files listing ends up like this : 001 - Great Song.mp3 001 - Fantastic Song.mp3 002 - Fabulous Song.mp3 003 - Super Song.mp3 The index is being duplicated, and is becoming useless. It would need to have a custom script to rename all files, but it is a bit tricky as it would need to decide which file is **newer**, but using the modification time can be wrong. It could be as worse as the number of new videos increases... for example : 001 - Great Song.mp3 001 - Fantastic Song.mp3 002 - Fabulous Song.mp3 002 - OMG Song.mp3 003 - Super Song.mp3 003 - Magic Song.mp3 004 - Example Song.mp3 005 - ... 006 - ... 007 - ... 008 - ... The solution would be to **add an option** to _youtube-dl_ to **rename** all the files when downloading a playlist. This use case can be see and named as a **playlist rsync** tool. The **rsync** notion does not seem to be possible actually. **Note** : I searched in the closed issue and something might be similar but closed for no reason (https://github.com/ytdl-org/youtube-dl/issues/27052)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#22533
No description provided.