Search code examples
youtube-dl

Prepend the upload date to the name of the video-file


I would like to prepend the upload date to the name of every file (be it a single video or a playlist -- I would like to have all downloaded videos sorted by the date), which I download. I tried to use following code:

youtube-dl -f best  -v -o "%(upload_date)s/%(creator)s - %(title)s.%(ext)s" https://www.youtube.com/watch?

However, when this code was passed to youtube-dl, it created a separate folder, which name is the upload date of the video, and downloaded the video in that folder. I do not need this, I would like to have the date to be added to the name of the file. How can I modify my code?


Solution

  • Change your commad to the following one. youtube-dl -f best -v -o "%(upload_date)s%(creator)s - %(title)s.%(ext)s" https://www.youtube.com/watch? You have to write it without the slash becasue that creates a new folder.You could separate it with something else like a dash for example.