Kando wrote: ↑Wed May 29, 2024 1:25 am
By the way Bat Lord, do you or anyone else here have any idea how the h@ll the following cmd line is supposed to work. It is supposedly for downloading a better video quality of a YT vid, but I don't see how in the world you get it to do so for any particular YT link, and those espousing this did not bother to elaborate any farther on it.
yt-dlp -f "bv*[height<=1080][ext=mp4]+ba[ext=m4a]/b[height<=1080][ext=mp4] / bv*+ba/b"
It looks like it's getting the largest video available, but only if it's mp4 (as there are other formats available).
What I do is...
yt-dlp --list-formats YOUTUBE-URL
Then choose which formats you want, then download in the format
yt-dlp --write-description -f 135+140 YOUTUBE-URL
Where in this example video format 135 has been chosen, and audio format 140.
Make sure you list the video format first, then audio (if you put the audio first it won't work), but to make it easier it's always +140 because there is no higher quality audio format.
The addition of --write-description (which you can omit if you don't want it) also writes the description to a text file (and if there's no description you get a blank file).
Sometimes depending on the video format it's unable to combine them to make an .mp4 so it'll make an .mkv instead, which is perfectly fine if you don't mind it being mkv.
And if you just want the description but not the video
yt-dlp --write-description --skip-download YOUTUBE-URL
If you want to download part of a playlist but not the whole thing, for example tracks 23 to 40...
yt-dlp -f 140 --playlist-start 23 --playlist-end 40 YOUTUBE-PLAYLIST-URL
With regard to higher quality audio...
When you do a list formats you'll see some of the video formats are .webm
These .webm files used to have their audio format as .ogg and were slightly higher quality, although the difference was negligible and often not worth the extra step of downloading then extracting the audio.
But they appear to have stopped using .ogg and now there's a "webm audio only" option of type .opus and I'm told this is sometimes higher quality, so that's something to check out.