I read somewhere that it is possible to rip youtube videos (music only) without the need for converting it into an mp3 as such.
The online conversion process (naturally) results in loss of quality, and (apparently) it is possible to preserve the original video’s audio quality via a direct rip. If so, how would it be done and what format would it be in anyway?
thanks
if you use yt-dlp or youtube-dl’s
-F
flag you can get back a list of available formats. There are typically separately encoded audio tracks for most content on youtube, meaning you can just give it the stream id and get an m4a or webm file with no extra work.The fork yt-dlp already downloads in the highest quality.
The problem is that, that’s (sometimes?) webm format…
This is what I use for my personal archive:
yt-dlp -f bestaudio/best --extract-audio --embed-metadata --embed-thumbnail --recode opus --audio-quality 0
It does recode to
opus
but since thebestaudio
is usually in that format already, you don’t need it most of the time. You can skip the--recode opus
part if you want to. I keep it because I like having a “uniform” collection. You can probably change thebestaudio/best
part to simplybestaudio
without losing much as well.Does it skip the recode completely if the format is already opus?
Yes, it does. It just repackages it from
.m4a
to.opus
without re-encoding the actual audio stream.
yt-dlp has the
-F
parameter to list the available stream formats. (uppercase F to list, lowercase f to select)I use
-f 251
to download the opus audio stream, and afterwards useffmpeg -i file -c copy file.opus
to copy the opus audio stream in an opus file format file (codeccopy
so without encoding losses).YouTube compresses the video as soon as it’s uploaded, so it’s unlikely you can obtain any sort of lossless download. You may be able to get a .wav or similar download of a video’s audio track, but there will still be compression losses from the YouTube side.
I dunno about the qualilty but I do
yt-dlp -x
and it downloads and extracts just the audio portion.I use this app for it. Even adds the correct artist, title, album and such to the file aswell. I tried several similar apps but this was by far the best.
+1 for MediaHuman, if you’re wanting a GUI. Super simple and powerful. It’s paid software but there are cracks around.
It’s not paid though?
I think the YouTube Downloader is paid and they might be getting it confused.
Oh I’m four days late but yes. The YouTube downloader also downloads audio, I didn’t realize they had a separate program that only downloads audio. Weird.