Is it possible to not change the file created date when embedding thumbnail using youtube-dl?

Viewed 400

I was trying to download videos from YouTube using youtube-dl with the following:
youtube-dl -f "bestvideo+bestaudio" --merge-output-format mp4 --add-metadata --embed-thumbnail {video URL}

I want to have both the thumbnail embedded in the output file and also the upload date of the YouTube video written as the "Date created" of the output file.

I was able to write the upload date of the video on YouTube to the output file as the "Date created" by using --add-metadata {URL}.
But if I was also embedding the thumbnail to the output using --add-metadata --embed-thumbnail {URL}, the "Date created" and "Date modified" of the output file becomes the time the video thumbnail was written to the disk (aka 'now') but not the upload date of the video on YouTube.

Is there any way to get the output I want to get by using youtube-dl?

2 Answers
  1. Save the date created and/or the date modified of the downloaded video.
  2. Add metadata for thumbnail
  3. Set the created and/or modified date using touch. To see the help for touch, type:
    $ man touch
    

This is a youtube-dl bug, here is the relevant issue on GitHub.

Unfortunately, youtube-dl is quite bad at accepting pull requests and bug fixes, and many such bugs remain. yt-dlp (an actively maintained youtube-dl fork) doesn't seem to have this bug, so that's what I switched to now. (yt-dlp is also able to embed thumbnails to mkv files, something youtube-dl couldn't do, as well as other bugfixes and features.)

Related