I am trying to download an entire playlist using youtube-dl, this way :
youtube-dl -citwx --audio-format mp3 --audio-quality 320K <playlist>
I believe it extracts the audio without having to download the actual video.
The problem is that I want to be able to stop and resume this download, which is impossible using only these arguments. However, if I add the -k option, the program will download the original videos (which takes a lot longer), convert them, and keep the original files (which takes a lot more space).
Is there any way for me to resume such a transfer without having to download the actual video files?
Sounds to me like there is no way. If it takes just the audio, seems like it needs to be done in one go. Maybe try writing a script that takes the file path and url as arguments, and pass those into a youtube dl script, then when that's done also deletes the video file. takes more time that way, but the space issue is gone.
I found the answer while browsing the man page :
--download-archive FILE Download only videos not listed in the
archive file. Record the IDs of all
downloaded videos in it.
youtube-dl -citwx --download-archive progress.txt --audio-format mp3 --audio-quality 320K <playlist> is the correct command.
A note, --title is deprecated. The correct command should be youtube-dl -ciwx -o "%(title)s.%(ext)s" --download-archive progress.txt --audio-format mp3 --audio-quality 320K <playlist>
Related
In youtube-dl cli, How can i get information about the video (in json output) while the video beign downloaded by the app?
When i use this command:
youtube-dl https://www.youtube.com/watch?v=jNQXAC9IVRw
It only shows me output filename, But what a about the duration, resolution, etc... ?
I do this with 2 requests, But is it possible in on go?
It would be great if it dump the video meta data into a json file as well as output filename, Because i also struggling to pragmatically get the path of downloaded file (i have to use regex)
Just add --print-json in your command line.
youtube-dl --print-json https://www.youtube.com/watch?v=jNQXAC9IVRw
This outputs a big JSON, while video is still downloading
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?
Save the date created and/or the date modified of the downloaded video.
Add metadata for thumbnail
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.)
I tried the following command in order to get the best video and audio quality (I can also avoid to write --format best because from the documentation I read that this is the default setting):
youtube-dl.exe --format best https://www.youtube.com/watch?v=7wfUUZvybPY
and I got a video.mp4 with the following characteristics:
I downloaded the same video by using 4k Video Downloader and I got:
How can I get the same result also by using youtube-dl?
You can parse all formats available with:
youtube-dl.exe -F https://www.youtube.com/watch?v=7wfUUZvybPY
Look at first column, "format code". For this video, best option is:
youtube-dl --format 315 https://www.youtube.com/watch?v=7wfUUZvybPY for 3440x1440 video, and
youtube-dl --format 140 https://www.youtube.com/watch?v=7wfUUZvybPY for 129kbit audio.
Then, with ffmpeg, you can merge that two streams in your preferred container (you can find many answers here in Stackoverflow).
For very high bitrates there isn't a file already merged available on YouTube, ffmpeg is a crucial tool for this type of conversions!
I'm trying to download a 4k video from youtube. For this, I used the command
youtube-dl -f best https://youtu.be/VcR5RCzWfeY
However, using this command only downloads the video in 720p. Manually specifying the resolution, however, seems to work:
youtube-dl https://youtu.be/VcR5RCzWfeY -f 313+bestaudio
The documentation states that using nothing should download the best quality possible, but I always get the default quality of 720p. This tends to be an issue when I am downloading playlists with multiple file qualities. So what gives? Is there some other code I should be using?
youtube-dl downloads the best quality by default. (This may not be the highest resolution for all of the supported sites, but it tends to be that one for YouTube.)
-f best is not the default. It advises youtube-dl to download the best single file format. For many supported sites, the best single format will be the best overall, but that does not apply to YouTube.
To get the highest quality, simply run youtube-dl without any -f:
youtube-dl https://youtu.be/VcR5RCzWfeY
For your example video, this will produce an 7680x4320 video file weighing 957MB.
Note that this requires ffmpeg to be installed on your machine and available in your PATH (or specified with --ffmpeg-location). To find out which version of ffmpeg you have, type ffmpeg.
I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files.
I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata.
I'm planning on creating a little C++ app to dig into each file and get the metadata.
any input is appreciated.
( alternatively, if you know of an app that already does this I'd like to know :)
Have you looked at the libexif project http://libexif.sourceforge.net/?
ok, so I did a google search (probably should have started with that) for "batch rename based on exif data arw dng jpg"
and the first page that popped up was the ExifTool by Phil Harvey
it supports recent arw and dng files, and with some command line magic I should be able to get it to do what pretty much what I want
exiftool -r -d images/%Y-%m-%d/%Y%m%d_%%.4c.%%e "-filename<filemodifydate" pics
-move files to folders (images/YYYY-MM-DD/) and rename files to YYYYMMDD_####.ext that are in pics folder(and subfolders)
hope this helps others
You should also try Adobe XMP SDK, which is great for its supported formats (JPEG, PNG, TIFF and DNG).