this post was submitted on 04 Nov 2023
77 points (93.3% liked)

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

54443 readers
1128 users here now

⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don't request invites, trade, sell, or self-promote

3. Don't request or link to specific pirated titles, including DMs

4. Don't submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

founded 1 year ago
MODERATORS
 

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

all 24 comments
sorted by: hot top controversial new old
[–] SexualPolytope@lemmy.sdf.org 31 points 1 year ago* (last edited 1 year ago) (1 children)

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 the bestaudio 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 the bestaudio/best part to simply bestaudio without losing much as well.

[–] TwinHaelix@reddthat.com 4 points 1 year ago (1 children)

Does it skip the recode completely if the format is already opus?

[–] SexualPolytope@lemmy.sdf.org 8 points 1 year ago

Yes, it does. It just repackages it from .m4a to .opus without re-encoding the actual audio stream.

[–] Dettweiler42@lemmyonline.com 25 points 1 year ago (1 children)

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.

[–] OpenHammer6677@lemmy.world 1 points 1 year ago

This here answers OPs question. Most comments talk about download quality but YouTube's compression on upload is the biggest factor IMO.

[–] pr06lefs@lemmy.ml 23 points 1 year ago (2 children)

I dunno about the qualilty but I do yt-dlp -x and it downloads and extracts just the audio portion.

[–] infinull@lemmy.dbzer0.com 18 points 1 year ago

This uses ffmpeg under the hood and muxes the file into a .m4a file without transcoding. Basically keeping whatever compression youtube used for the audio (which is some sort of mpeg4 compatible audio, probably depends a little bit)

This still recompressed, but it's the best you can do using youtube as the source.

  • uploader (almost certainly, but theoretically you could skip this step if you encoded your video well) compresses audio
  • uploader uploads to youtube
  • youtube re-compresses the audio again (almost certainly transcoding into a different codec)
[–] Kissaki@feddit.de 21 points 1 year ago

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 use ffmpeg -i file -c copy file.opus to copy the opus audio stream in an opus file format file (codec copy so without encoding losses).

[–] guitarsarereal@sh.itjust.works 16 points 1 year ago (1 children)

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.

[–] XEAL@lemm.ee 9 points 1 year ago (2 children)

The fork yt-dlp already downloads in the highest quality.

The problem is that, that's (sometimes?) webm format...

[–] neo@lemmy.comfysnug.space 3 points 1 year ago (1 children)

WARNING: webm doesn't support embedding a thumbnail, mkv will be used

Embed thumbnails, you'll never see a webm again.

[–] XEAL@lemm.ee 1 points 1 year ago

I resorted to a shitty script that gets the most m4a video quality using grep and awk.

Is the thumbnail embedding a yt-dlp feature?

Your intended playback device impacts which format you'll want. Or maybe I'm just fussy, I dunno.

[–] BMP5k@feddit.uk 6 points 1 year ago

I believe Jdownloader 2 lets you do link grabber with YouTube links that can download audio only with a choice of format.

[–] BetaDoggo_@lemmy.world 4 points 1 year ago

Get yt-dlp then run: yt-dlp -x 'video-url'

I believe if you're willing to check the format codes on the video you can download audio only but both will get you the least compressed audio available.

[–] sho@lemmy.ml 2 points 1 year ago

Easiest way is to use an Indivious instance, if you are on desktop or use the Newpipe App if on Android.

[–] rikonium@discuss.tchncs.de 1 points 1 year ago* (last edited 1 year ago)

Not a direct answer but for a while I had iTunes Match as a companion service which could be an imperfect workaround to get your hands on 256 Kbps AAC versions. (if it matches, which can’t be manually done)

I bailed when it glitched on a couple songs and syncing broke for a while. Direct iTunes sync hasn’t let me down since but it was nice while it lasted and the Matched songs I had are still kicking.

Of course it requires using iTunes and paying for that $25 for a non-guaranteed quality boost.

[–] lea@feddit.de 1 points 1 year ago

If you want an online tool, cobalt.tools can rip the original youtube audio if you choose "best" format in settings -> 🎶. It's also FOSS with no tracker/ad garbage so I can recommend it as an alternative for yt-dlp which has been mentioned already.

[–] Thorny_Insight@lemm.ee 1 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] CloverSi@lemmy.comfysnug.space 0 points 1 year ago (1 children)

+1 for MediaHuman, if you're wanting a GUI. Super simple and powerful. It's paid software but there are cracks around.

[–] Thorny_Insight@lemm.ee 0 points 1 year ago (1 children)
[–] SomeRandomWords@lemmy.blahaj.zone 1 points 1 year ago (1 children)

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.