Live data from Hacker News

Open Source YouTube to MP3 Downloader

github.com

81–90 of 92 posts

Re: Open Source YouTube to MP3 Downloader

#81
post #78
post #49

Earlier quoted context omitted.

Does it work? Looking at the code, the regex it uses to find the urls seems to be: document.documentElement.innerHTML.match(/https?:\/\/[^\s/$.?#].[^\s]*videoplayback(?:\?|%3F)[^'"]+/g) Tried this on two videos and it returned null both times.

Hmm, I'm not the creator of it, but yes it's been working for me. I would have thought a regex match would be pretty universal. I'm using a chromium based browser if that matters. Here's what I see when I use it: https://i.imgur.com/7eS132D.png

I tried in FireFox and Chromium on Linux, and get no matches in both browsers.

On Windows in Chrome, it indeed works.

Re: Open Source YouTube to MP3 Downloader

#82

for those of us comfy with the console: yt-dlp -x [YouTube or other url]

imo a better alternative (did not test on other sites)

yt-dlp -f bestaudio

it directly downloads the audio from youtube and does not require ffmpeg unlike the -x option. moreover, you can specify format (m4a or default webm) like so - replace "bestaudio" with "bestaudio[ext=]"

this only falls short unless you explicitly need it in mp3 container.

Re: Open Source YouTube to MP3 Downloader

#83

YouTube presents audio in 2 forms under various bitrates and formats. AAC and OPUS. The Opus track @128kbps (even better than the sometimes available AAC @160kbps) is the highest quality and can be downloaded and played back by demuxing its WebM container to .opus or using a player which understands the WebM container. This is what I prefer: Downloading original OPUS audio, demuxing to .opus, without reconversions us…

I remux into ogg which still supports Opus but seemed to have wider player support. Great way to get tracks that don't seem to be available anywhere other than streaming.

Matroska Audio (.mka) is also a nice choice

https://en.wikipedia.org/wiki/Matroska

Re: Open Source YouTube to MP3 Downloader

#87
post #37

Earlier quoted context omitted.

Doesn't work with DASH

Can't you still work around DASH by changing your user agent, claiming that you are running Safari? (It used to be the case, but I haven't been in the streaming industry for years now so it may be obsolete)

What do you mean work around DASH?

DASH is the correct way to do this. The combined formats are legacy.

Re: Open Source YouTube to MP3 Downloader

#88
post #87

Earlier quoted context omitted.

Can't you still work around DASH by changing your user agent, claiming that you are running Safari? (It used to be the case, but I haven't been in the streaming industry for years now so it may be obsolete)

What do you mean work around DASH? DASH is the correct way to do this. The combined formats are legacy.

I mean “work around the fact it doesn't work with DASH”

Also, MPEG-DASH is the typical bloated design-by-committee standard, that have twenty ways to do the same thing and that makes it very hard to implement fully. It's PDF or SVG all over again.

(I uses to work on an implementation of a DASH web player that had much better coverage of the standard that the reference implementation back in 2015, and I can tell you it was a PITA)

HLS, while a bit primitive in a few annoying way (inclusing the fact that it mandated, at the time, the use of MPEG-2 TS), is at least a pragmatic standard that is reasonably implementable. (Even though HLS.js being really good compared to the DASH alternative makes it less likely that you'd need to do it by yourself).

Post reply on HN