News for hackers. Stuff that matters.
Re:You-get: Dumb downloader that scrapes the web by andai on Sunday October 27, 2024 @01:25PM (#41964119)
For a while I had expensive internet and low bandwidth, but I loved listening to music and lectures on YouTube. At some point I realized that getting only the audio stream would save me 90% in bandwidth costs. [0]

youtube-dl (and yt-dlp) has a flag, I believe -G, which gives you the URL(s) for the requested format/quality. I used the command line on my computer and put the link in VLC. On my phone I had this elaborate workaround involving downloading the file to my VPS first over SSH, then downloading it to my phone, until I realized my phone browser can consume the URL directly, so I set up a PHP frontend for `youtube-dl -G -f bestaudio {url}`

It's no longer online and I lost the code, but it was like one line of code.

I mention this because you-get seems to support the same usecase (via --url / -u), so I wanted to let people know how useful this is!

(While it was online I shared it on some forums and got very positive feedback, people used it for audiobooks etc.)

[0] Also playing with screen off saves 80% battery life! YouTube knows these facts and that's why they made background playback (which fetches only audio stream) a paid feature...

Re:You-get: Dumb downloader that scrapes the web by TechDebtDevin on Sunday October 27, 2024 @01:57PM (#41964322)
Brave Mobile browser allows turning on background video audio thus eliminating the need for YouTube Premium and similar subscriptions.
Re:You-get: Dumb downloader that scrapes the web by l3x4ur1n on Sunday October 27, 2024 @02:49PM (#41964692)
I don't know why your comment is downvoted because I use this feature of Brave very often and I also exclusively watch YT in Brave mobile (no ads).
Re:You-get: Dumb downloader that scrapes the web by gaudystead on Sunday October 27, 2024 @03:21PM (#41964912)
For me, it was as easy as adding a shortcut to the YouTube homepage on Brave that it basically acts like the YouTube app, but with ad blocking built in. It's the only way I watch YT videos on mobile.
Re:You-get: Dumb downloader that scrapes the web by icar on Sunday October 27, 2024 @05:28PM (#41965831)
You might be interested in GrayJay app.
Re:You-get: Dumb downloader that scrapes the web by Sabinus on Sunday October 27, 2024 @07:02PM (#41966419)
It's a really cool idea for an app. Pity that Google takes down the videos where Rossman talks about it.
Re:You-get: Dumb downloader that scrapes the web by TechDebtDevin on Sunday October 27, 2024 @05:18PM (#41965765)
There are a lot of people that don't like Brave's business model. But I've never given Brave a dime and turn off their ad network stuff and they've saved me hundreds of dollars on Youtube Premium over the years.
Re:You-get: Dumb downloader that scrapes the web by cocok on Sunday October 27, 2024 @06:45PM (#41966314)
Re:You-get: Dumb downloader that scrapes the web by bonestamp2 on Sunday October 27, 2024 @11:44PM (#41967665)
This works great, thank you.

For others: Settings > Media > Enable Background Audio

Re:You-get: Dumb downloader that scrapes the web by BiteCode_dev on Monday October 28, 2024 @08:54AM (#41970603)
New Pipe X if you need a full client does that as well.
Re:You-get: Dumb downloader that scrapes the web by marci on Monday October 28, 2024 @09:28AM (#41970832)
I know of NewPipe (Android) but can't find anything about New Pipe X
Re:You-get: Dumb downloader that scrapes the web by jqr- on Monday October 28, 2024 @10:53AM (#41971610)
Re:You-get: Dumb downloader that scrapes the web by khimaros on Sunday October 27, 2024 @03:59PM (#41965179)
on Android YTDLnis solves this very nicely. simply share the video URL to the app and it can download whichever format you like https://github.com/deniscerri/ytdlnis
Re:You-get: Dumb downloader that scrapes the web by 6yyyyyy on Sunday October 27, 2024 @02:34PM (#41964584)
NewPipe can do this very nicely, it even lets you build a playlist of videos.
Re:You-get: Dumb downloader that scrapes the web by wutwutwat on Sunday October 27, 2024 @03:22PM (#41964923)
A service that takes arbitrary user input and then attempts to download/proxy whatever is at the end of that input. Brave soul.
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.
Re:You-get: Dumb downloader that scrapes the web by Synaesthesia on Sunday October 27, 2024 @02:25PM (#41964523)
BTW if you browse YouTube with Firefox browser on Android you can play back YouTube videos with the screen locked using background player fix extension.
Re:You-get: Dumb downloader that scrapes the web by tirpen on Monday October 28, 2024 @06:13AM (#41969509)
That works fine without any extensions at all, so I'm unsure what does the extension even does?
Re:You-get: Dumb downloader that scrapes the web by Liquid_Fire on Monday October 28, 2024 @12:02PM (#41972596)
YouTube deliberately tries to prevent background playback by using web APIs to detect when the page is no longer visible and pausing the video. The extension prevents YouTube from doing that.
Re:You-get: Dumb downloader that scrapes the web by kevin_thibedeau on Monday October 28, 2024 @01:03PM (#41973453)
Or just switch FFA to desktop mode.
Re:You-get: Dumb downloader that scrapes the web by 01HNNWZ0MV43FF on Sunday October 27, 2024 @01:48PM (#41964265)
I think it's -x to just rip audio now
Re:You-get: Dumb downloader that scrapes the web by cquintana92 on Sunday October 27, 2024 @06:07PM (#41966061)
One of my last weekend projects was something similar: convert youtube playlists into podcast-compstible URLs:

https://github.com/cquintana92/yt2pc

Re:You-get: Dumb downloader that scrapes the web by dredmorbius on Sunday October 27, 2024 @06:33PM (#41966220)
mpv similarly has this option. I listen to far more videos than I watch.

<https://mpv.io/>

Re:You-get: Dumb downloader that scrapes the web by Gormo on Monday October 28, 2024 @07:58AM (#41970187)
MPV is just passing the stream selection arguments over to youtube-dl/yt-dlp.
Re:You-get: Dumb downloader that scrapes the web by dredmorbius on Monday October 28, 2024 @06:59PM (#41977456)
Sure, and you can set that directly in your mpv config:

  ytdl-format=bestaudio[ext=m4a]/bestaudio[ext=webm]/bestaudio
  vo=null
The advantage is that you're setting this for a utility which can play media directly (e.g., you don't have to separately download and then play content), and that you can set preferences independently for mpv vs. other tools.

You can also of course configure your own aliases, shell functions, shell scripts, or config files for various preferred configurations, whether using mpv, ytdl, or other tools.

Re:You-get: Dumb downloader that scrapes the web by Gormo on Wednesday October 30, 2024 @08:38AM (#41994179)
Yup, it's pretty great.

It's worth noting, though, that ytdl can output video content to stdout, so it is possible to stream video by piping to any player, although mpv's method is much more convenient.

Sometimes it is necessary to download files regardless, though, due to DASH separating audio and video into distinct files. You often need to remux them with a container like MP4, AVI, or Matroska in order to use them locally.

Re:You-get: Dumb downloader that scrapes the web by dredmorbius on Thursday October 31, 2024 @08:45PM (#42013008)
And yup back at'chya.

mpv's bonus is convenience, and the fact that it will seamlessly play much of what you throw at it, whether that's local files, network resources, web sites, etc. Much of that majyck is in fact ytdl/yt-download, but having a standard interface is quite handy.

And yes, I've run into streams that need mixing, which ytdl/yt-download can handle; you point it at both the video and audio sources, typically. (I do this infrequently, thankfully).

Re:You-get: Dumb downloader that scrapes the web by EasyMark on Sunday October 27, 2024 @08:52PM (#41966904)
Just switching tabs will dramatically lower energy usage without using any scripts. I assume the YouTube video player may download and just drop the video information if not showing it, no need to render decrypt the video stream.
Re:You-get: Dumb downloader that scrapes the web by lights0123 on Sunday October 27, 2024 @09:48PM (#41967140)
YouTube doesn’t encrypt the media stream other than TLS. Decoding the video can be skipped though.
Re:You-get: Dumb downloader that scrapes the web by hot_gril on Sunday October 27, 2024 @09:19PM (#41967021)
Seems like youtube-dl doesn't work anymore. I had to use a fork yt-dlp. Always makes me nervous hopping from one project to another like that, but seems like it's commonly used at least.
Re:You-get: Dumb downloader that scrapes the web by shiroiushi on Monday October 28, 2024 @12:05AM (#41967787)
youtube-dl has been dead for many years now; it's a lot like XFree86, where the original project is a zombie with very few real users, but the original maintainers refuse to acknowledge reality and just shutter the thing, so newcomers get confused. Everyone's moved to yt-dlp now.
Re:You-get: Dumb downloader that scrapes the web by RGamma on Wednesday October 30, 2024 @05:33AM (#41993229)
The author(s) got into legal trouble.

https://youtube-dl.org

> Due to a ruling of the Hamburg Regional Court, access to this website is blocked.

https://openjur.de/u/2466945.html

Re:You-get: Dumb downloader that scrapes the web by shiroiushi on Wednesday October 30, 2024 @10:00PM (#42002694)
For providing a tool that lets people download YT videos? The same should apply to yt-dlp, but that project is hosted on github.com with no apparent problems. What's stopping the youtube-dl people from doing the same and just ignoring this silly court ruling?
Re:You-get: Dumb downloader that scrapes the web by RGamma on Thursday October 31, 2024 @05:33AM (#42004956)
The case is about downloading music or rather enabling others to do so ("Beihilfe"). GEMA really is quite terrible.

What's stopping them? Dunno, (the threat of) police showing up at the door? Shitty pop songs are not worth going to prison for.

Re:You-get: Dumb downloader that scrapes the web by shiroiushi on Thursday October 31, 2024 @08:19PM (#42012871)
Apparently this isn't stopping the yt-dlp people.
Re:You-get: Dumb downloader that scrapes the web by hot_gril on Sunday November 10, 2024 @11:17AM (#42100932)
Maybe they aren't German
Re:You-get: Dumb downloader that scrapes the web by TowerTall on Sunday October 27, 2024 @09:51PM (#41967153)
I am using the GUI version on windows https://oleksis.github.io/youtube-dl-gui/
Re:You-get: Dumb downloader that scrapes the web by andai on Sunday October 27, 2024 @09:53PM (#41967161)
Yeah, yt-dlp is the successor. I've been using it for years.
Re:You-get: Dumb downloader that scrapes the web by soheil on Sunday October 27, 2024 @11:34PM (#41967624)
I often choose 144p for low bandwidth scenarios. It is very similar to a good quality audio-only stream in terms of size, but you get the added benefit of looking at the speaker even if that's a glance every 45 mins. Same for battery life, you save that too.

Also 144p is somehow so peaceful and relaxing to watch, you don't get distracted with all the shiny colors and intricate details in the video and can just listen and not have your mind focus on some random stuff.

Re:You-get: Dumb downloader that scrapes the web by dgan on Monday October 28, 2024 @04:06AM (#41968713)
Me too, i don't enjoy observing people's pimples on the nose
Re:You-get: Dumb downloader that scrapes the web by Karrot_Kream on Monday October 28, 2024 @02:46AM (#41968342)
When I use NNCP [1] on flights to download Youtube videos, the script I wrote to nncp-exec the download accepts a quality friendly name. I have a specific friendly name which gets the lowest quality video and mid-tier audio. These settings usually result in a pretty enjoyable experience and offer plenty of entertainment even on a longer flight.

[1]: http://www.nncpgo.org/

Re:You-get: Dumb downloader that scrapes the web by entropie on Monday October 28, 2024 @10:05AM (#41971118)
> It's no longer online and I lost the code, but it was like one line of code.

My mom is really into audiobooks and I made telegram bot for her via node-red where she can share youtube links. The links are sent to a fifo where a little daemon (1) downdloads them sequential and saves them into an incoming folder I setup for this special purpose. The bot can either download only audio (for her telegram ID its only audio) or complete videos.

This folder is watched by jellyfin which she can access to download or listen. She loves it and in two years she downloaded way over a TB of audiobooks.

1: https://gist.github.com/entropie/d265e94136b9777cc6b3190189b...

Re:You-get: Dumb downloader that scrapes the web by doruk101 on Monday October 28, 2024 @01:34PM (#41973799)
You can glitch out Safari on IOS -by quickly pressing the play button for the video in the now playing interface after switching off from the Safari app- to play the audio of Youtube videos on the background.

I mainly use this to play membership only videos that don't play in the background even if you have a Youtube Premium.

Every IOS version I pray that they don't patch this "glitch".

Re:You-get: Dumb downloader that scrapes the web by ambiguousninja on Monday October 28, 2024 @02:50PM (#41974677)
Interesting, I don't use premium but is there a reason membership only videos don't support background audio? Seems like a weird exclusion