News for hackers. Stuff that matters.
Re:You-get: Dumb downloader that scrapes the web by ww520 on Sunday October 27, 2024 @02:02PM (#41964352)
That’s the -F option to list all the formats, including the audio streams. Pick the audio format with -f to download the audio. I usually pick the .m4a format and then run it through ffmpeg to convert to mp3.
Re:You-get: Dumb downloader that scrapes the web by andai on Sunday October 27, 2024 @04:13PM (#41965283)
Same but I converted to Opus, because I was trying to squeeze it into as little bandwidth as possible. It was mostly speech content and Opus auto detects and optimizes for speech at low nitrates.
Re:You-get: Dumb downloader that scrapes the web by lozf on Sunday October 27, 2024 @07:02PM (#41966421)
You can download the Opus directly with -f 249 / 250 / 251 (~48kbps / ~80kbps / ~128 kbps respectively, but youtube don't always make them all available, where are -f 140 for the ~128kbps AAC (.m4a) is always available, and often the format code 139 (~48kbps) - the lower bitrates being adequate for most speech based content.
Re:You-get: Dumb downloader that scrapes the web by krick on Sunday October 27, 2024 @02:48PM (#41964684)
That's really unnecessarily complicated workflow you have. It's achievable by yt-dlp with just 3 flags:

--extract-audio

--format bestaudio

--audio-format mp3

Re:You-get: Dumb downloader that scrapes the web by knowitnone on Sunday October 27, 2024 @05:45PM (#41965934)
you're unnecessarily making huge assumptions. Some people don't want the bestaudio or mp3
Re:You-get: Dumb downloader that scrapes the web by krick on Sunday October 27, 2024 @06:52PM (#41966348)
If I would make any assumptions, I would post another 30 options from my config that are nice to have when you download audio from youtube. These 3 are exactly equivalent to what gp does.
Re:You-get: Dumb downloader that scrapes the web by panckreous on Monday October 28, 2024 @08:30AM (#41970411)
separate from above - willing to share your config anyways? I love me some yt-dlp configurations
Re:You-get: Dumb downloader that scrapes the web by scubbo on Sunday October 27, 2024 @08:50PM (#41966896)
> then run it through ffmpeg to convert to mp3.

> Some people don't want [...] mp3

Re:You-get: Dumb downloader that scrapes the web by kevin_thibedeau on Monday October 28, 2024 @01:02PM (#41973435)
Direct to mp3 doesn't expose all the encoding options one may want.
Re:You-get: Dumb downloader that scrapes the web by KMnO4 on Sunday October 27, 2024 @02:12PM (#41964409)
What’s the point of converting it to mp3? AAC inside an m4a container usually has better sound quality than similarly compressed mp3, and definitely better than reencoding.
Re:You-get: Dumb downloader that scrapes the web by userbinator on Sunday October 27, 2024 @05:21PM (#41965789)
MP3 is accepted by far more players.
Re:You-get: Dumb downloader that scrapes the web by hollandheese on Sunday October 27, 2024 @08:26PM (#41966801)
But why not just download the mp3 then?
Re:You-get: Dumb downloader that scrapes the web by Almondsetat on Monday October 28, 2024 @02:22AM (#41968252)
From where?
Re:You-get: Dumb downloader that scrapes the web by raffraffraff on Monday October 28, 2024 @03:34AM (#41968560)
I think the point here is that you can run `yt-dlp --extract-audio --audio-format mp3` instead of saving as .m4a (a lossy compression) and then covering that to .mp3 (another very different lossy compression).

Under the hood, there's probably an additional lossy conversion. I'm not sure if YouTube converts uploaded videos to specific formats but if they do, then the worst case scenario is:

- original uploaded video uses .ogg audio

- YouTube converts that to opus and puts it into a container format (wbem?)

- You download the video and extract the audio to .m4a using yt-dlp

- and then you convert that to .mp3 using ffmpeg

That's 4 consecutive lossy formats, each one throwing away different data.

Honestly the best thing to do here is use yt-dlp to download whatever format YouTube provides and use ffprobe to find out what audio format is already there. Then do one conversation if required.

Re:You-get: Dumb downloader that scrapes the web by Gormo on Monday October 28, 2024 @08:04AM (#41970242)
I usually just extract the raw Opus audio, then run it through Picard to tag and save it in my music directory. I don't see any point in converting to MP3 these days -- Opus provides better audio quality at the same bitrate (or, equivalently, lower file sizes for the same audio quality), and pretty much all player software supports it now. I've actually been going the other way and converting most of my music library to Opus and getting rid of MP3s.
Re:You-get: Dumb downloader that scrapes the web by KMnO4 on Sunday October 27, 2024 @08:36PM (#41966845)
Which players only accept mp3? Maybe this was true in the early 2000s
Re:You-get: Dumb downloader that scrapes the web by prmoustache on Monday October 28, 2024 @11:49AM (#41972398)
A good use case would be when you own a car built somewhere between 2005 and 2015 that accepts CDs and usb drives but only mp3 files. Some supported AAC and ogg files without them being advertised as compatible, but some might not.

Or when you keep using an old mp3 player from the early 2000's.

Re:You-get: Dumb downloader that scrapes the web by shiroiushi on Monday October 28, 2024 @12:06AM (#41967794)
Do you have examples of this that aren't 20+ years old?
Re:You-get: Dumb downloader that scrapes the web by userbinator on Monday October 28, 2024 @01:10AM (#41968022)
Many of the little generic MP3 player modules that cost next to nothing will play MP3 (obviously) and WAV, and sometimes OGG and WMA, but AAC support is relatively rare.