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...
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.
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.
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.
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.
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?
> 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.
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.
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".
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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).
As the other commenter said, they want a failing test, not a fix.
A detailed description of the encountered problem;
At least one commit, addressing the problem through some unit test(s).
Examples of good commits: #2675, #2680, #2685
"Addressing" is probably a bad word to use here. "Demonstrating" would have been better, IMO.
the most expensive piece of writing software is scoping work.
i’m almost tempted to add a test suite just to give people more agency over my output because right now i’m only soliciting feedback in person to cut down on internet bullshit, like what happened to xz-utils
The Chinese version of the text has an extra header line that translates to "to prevent abuse via GitHub Issues, we are not accepting general issues". An earlier commit has this for the English text:
`you-get` is currently experimenting with an aggressive approach to handling issues. Namely, a bug report must be addressed with some code via a pull request.
By the way, `tests/test.py` seems to just run the extractors against various websites directly. I can't find where it's mocking out network requests and replies. Maybe this is to simplify the process for people creating pull requests?
I can get this, but I aggressively report accounts and issues. I'm not sure how GitHub handles them but they seem to not come back.
Though what I'm unsure how to deal with is legitimate users being idiotic. For example, recently one issue was opened that asked where the source code was. Not only was there a directory named "src" but there were some links in the readme to specific parts. While I do appreciate GitHub and places like hugging face [0], there are a lot of very aggressive and demanding noobs.
I'd like ways to handle them better.... I'm tired of people yelling at me because 5 year old research code no longer works out of the box or because you've never touched code before.
[0] check any hugging face issue and you'll see far more spam. Same accounts will open multiple issues that just barate owners and hugging face makes it difficult to report these accounts.
The solution is to ignore them and close their issue. Open source maintainers have enough to worry about and are unpaid, it's okay to be a little dictatorial when it comes to "bad questions".
It addresses the specific issue but does nothing to prevent future similar issues. A solution to a cold is not handing someone a tissue.
I like that these platforms are open to everyone but at the same time there are a lot of people who have no business participating. Being able to filter those people out is unfortunately a necessary tool to not get overloaded.
Worse, I find that due to this many open source maintainers and up being quick to close issues and say rtfm. I can't tell you how many times I've had this happen where in my opening issue I quote the fm and even include a reproducible test. It's also common to just close and say "not our problem".
I kind of like this. It's a more formal proof of concept. You prove the bug exists by writing a failing test. If they cannot construct a failing test then it's either too hard to mock or reproduce (and therefore maybe not even worth fixing, for a free tool), or it's impossible because it's not a bug. Frees up maintainer time from dealing with reports that aren't bugs.
The problem with popular tools is that they have more bugs that can be fixed. So bug reports are pretty much worthless: You know that there are 1000 bugs out there, but you only have resources to fix 10 of them.
By asking users to provide reproducible test cases, you can massively reduce the amount of work you have to do. Of course that means 90% of bugs will never be reported. But since you don't have the resources to fix them anyway, why not just focus on the bugs that can be reproduced and come with a test case...
I don't think it's necessarily about fixing those bugs, but I think a lot of times it's more about at least having those bugs be documented in order to raise awareness on (probable) issues down the line for whoever would want to use that project in the future.
It’s your prerogative if and how you want to limit the amount of people who can contribute, but I was explicitly replying to someone claiming that a person’s inability to code is in any way related to the validity or importance of the bug.
If the bug is egregious enough, somebody else will find it. If the bug is important enough to you but esoteric, then ask on a forum or enlist the help of someone you know who does know Python.
How do you currently submit bug reports on e.g. MS Word or Adobe Photoshop? This way is certainly more open than those commonly-deployed software.
Good chance you wouldn't be writing good bug reports either, then. Github issues have enough noise that a first-pass filter like this feels like a good idea, even if it has some false positives.
This in no way aligns with reality. I frequently interact with users who can’t code at all but make good bug reports. One of the best ways to ensure success is to have a form (GitHub allows creating those) which describe exactly what is necessary and guide people in the right direction.
What you're saying is even worse, since you’re implying someone could be an expert computer programmer or power user, but because they’re unfamiliar with the specific language this project chose, they are incapable of making good bug reports. That makes no sense.
This isn't really a metric though. It's a formal existence proof that the bug exists. The key difference IMO is that you have to create a test which A) looks (to the maintainer) like it should pass, while simultaneously B) not passing. It's much harder to game.
There are other cases where Goodharts Law fails as well: consider quant firms, where the "metric" used to judge a trader is basically how much money you pull in. Seems to be working fine for them
Interesting. I like the idea of encouraging people to try creating a test or even a whole fix, but saying that’s all you will accept is a bit much. On the other hand, I’m not doing the work to maintain you-get. I don’t know what they deal with. This may be an effective way to filter a flood of repetitive issues from people who don’t know how to run a command line program.
I believe there are two extremes. On one end you get a bunch of repetitive non-issues, while on the other end you only get issues about (say) bugs in FreeBSD 13.3 because only hard-core users have the skills and patience to follow THE PROCESS.
I know how to make an isolated virtual environment, install the package, make a fork, create a test and make a PR. But I don't know whether I care enough about a random project to actually do it.
It’s relatively easy to write a failing test and it massively cuts down the work related to moderating issues. Also, reduces the danger of github issues turning into a support forum.
If this results in the project being easier to maintain and being maintained longer, then I’m fine with this.
In the case of this tool, adding a failing test case looks trivial if you've got the URL of a page it fails on.
Provided the maintainer is willing to provide some minimal guidance to issue reporters who lack the necessary know-how, it even seems like a clever back door way of helping people learn to contribute to open source.
you-get: [error] oops, something went wrong.
you-get: don't panic, c'est la vie. please try the following steps:
you-get: (1) Rule out any network problem.
you-get: (2) Make sure you-get is up-to-date.
you-get: (3) Check if the issue is already known, on
you-get: https://github.com/soimort/you-get/wiki/Known-Bugs
you-get: https://github.com/soimort/you-get/issues
you-get: (4) Run the command with '--debug' option,
you-get: and report this issue with the full output.
Tried with debug flag but didn't really help
pattern = str(pattern, 'latin1')
^^^^^^^^^^^^^^^^^^^^^^
TypeError: decoding to str: need a bytes-like object, NoneType found
I was curious to see if it can bypass age restriction (though I tried on non-age-restricted video too with the same error).
Given the title and the first few sentences from a description I assumed that it's some heuristic-based tool to try and grab whatever there is on the page, which would be useful if there's no tool which implemented the support for this site (which in most cases just means "yt-dlp doesn't support it"). But apparently it's also extractor-based with a separate extractor for each somewhat-popular source. So, basically it's just less sophisticated clone of yt-dlp?
I wouldn't exactly call a ytdl-style media downloader with a whole library of site-specific extractors and converters "dumb" but still cool that more projects like ytdl exist.
That's an interesting question. They only depend on a single library, but I wonder how much code is really their own. I found it curious, for example, that there is a dedicated mp4 joiner (I mean, if you already have ffmpeg, there is probably no way you can do it better yourself).
That is interesting, huh, yeah they list ffmpeg as a dependency so I wonder what that didn’t cover for them.
Though there are some cases where using pure ffmpeg is just to difficult or impossible. Recently i had such a case where I wanted to merge multiple video files from my GoPro (they come out in 4GB parts if the video is longer than that), but while keeping / correctly merging all metadata such as date / accelerometer / gps / any custom binary streams. Ended up using this and worked great https://github.com/gyroflow/mp4-merge
I’m not sure I understand why Bandcamp is on the list of supported sites: they allow you to just download the files on the condition you first pay the artist for them.
The fact you can download it with this tool is because the artist is letting you listen to it for free before buying it. Downloading it with this tool seems totally unnecessary and a bit of a jerk move. Bandcamp hosts mostly small and independent artists and labels.
Their list of supported sites isn't a declaration of where you should use this tool for moralistic reasons. It's just a list of popular sites it works on.
I presume you could subscribe and still use this tool? People use automation tools like this to download things that they already pay for because it saves them the effort of logging into 5 different apps depending on which walled garden it's in.
It’s Bandcamp: you buy the album and they give you a link to download it in whatever format you want so you can listen to it using whatever app or device you wish. You can come back later and download it as many times as you like.
What if I don't want to manually follow links or "come back later", but just add the album I purchased to the config for the same script I use for the rest of my media library?
Personal assumption, but probably not everyone lives in a country where they can pay Bandcamp.
And from personal experience I can say, sometimes people want or have to consume media offline, because of unreliable or slow network or expensive providers. But this doesn't mean that they won't pay later if they like it.
Different pirates have different moral codes regarding piracy; there is no standard.
Personally, I consider it immoral to pirate Windows without a very good reason (which doesn't include "I like using Windows", or "I want to play game X" or "I want to use the enterprise version which doesn't have baked-in ads").
It's probably an inverse of non-pirates who consider it a moral obligation to pay for a digital copy of something that does not diminish or remove the original
There are reasonable moral arguments against copyright infringement, but the false equivocation with stealing is not one of them.
The same moral principles that argue against depriving people of natural property they already own do not imply further arguments against reducing sales opportunities for non-rival goods for which scarcity has been artificially established via positive law. Other, unrelated principles, can make for compelling arguments, but not the same ones.
Most people do, since groceries are physical, rival goods to which natural property rights apply. But if it were possible to make copies of groceries while leaving the originals intact, far fewer people would argue against that on the same grounds. They might make other, unrelated arguments against copying, but moral principles applicable to physical property wouldn't be relevant.
Nice work. But as a consumer, Why should I use you-get over yt-dlp? What are its strengths over yt-dlp, which works quiet well on a huge range of websites[1]
I like this. I am imagining a companion extension for chrome/ff that uses you-get as a backend to implement it in a seamless way. Forward thinking idea: imagine going on youtube and have you-get extension bypass the youtube player and playing the content directly without ads. When I say youtube I might also say any other platform.
Can it back up a text webpage? Can it remove popups for newsletters, or subscription, or logins, or cookies' notifications? Can it read pages that require signing in?
the project appears to have an inaccurate description. perhaps it is the long-term goal, but today it behaves more or less like a subset of what yt-dlp does.
there is some polish to the interface, so it might still be worth trying out if it does what you need it for.
A future in which YouTube will refuse to stream you data because you didn't pass client attestation is definitely coming and I wish we could stop it.
It is a dark future where some of us will accept it, and rest of us will be constantly taking part in a cat-mouse chase in which we glitch out attestation tokens from vulnerable devices to get by.
Client attestation is a mechanism for servers to get cryptographic proof from a client about what software the client is running. Modified browsers, or software like yt-dlp, would have a harder time providing such proof. How hard a time would depend on the security hardening of the attestation mechanism. It'd almost certainly be broken, just as most attempts at DRM get broken, but it would be one more speedbump.
There are legitimate purposes for attestation; for instance, server attestation can allow a user to run software on a server and know that software matches a specific build and hasn't been subverted, so that the client can trust the server to do computation on the client's behalf.
But one of the leading uses of client attestation is DRM.
This library/program solves problems that people have with pages like youtube... too many ads, no way to download videos for offline use (or archive for when they get removed), and better performance with a native player.
If I was forced to watch all the ads on youtube, i wouldn't watch videos there at all.
Consuming not only their resources but also their incredible streaming algorithm for free is just a dirty move.
Doing this just puts you into the statistic of bad users that incentives companies like Google to push more intrusive DRM. Which at the end of the day makes us all suffer.
And I consider them bad advertisers and just don't care.
We had the internet without ads. Then we had the internet with small banner ads, that didn't track users but were there because of the page content. Then those ads moved from text/image to animated gif, and they became annoying. Then flash was used and it became a security concern. Then the number of ads went up and up, video was introduced, autoplaying, with audio, and at some point most of the internet is unusable without an adblock. It's not something we, the users, wanted, the advertisers (google included) made the internet unusable without an adblock, and that includes 3 25 second ads on a 1m20s video on youtube.
If advertisers returned to non-animated banners above/below the video, we wouldn't have to install adblocks everywhere anymore, and people would see the ad without wanting to kill the advertiser for bad intrusive advertising practices.
They started it, they went too far, we're just reacting to what they're doing. And as we've seen with other platforms, even paying for premium doesn't mean no-ads. And still an adblock is needed to remove the in-video ads ("this video is sponsored by shadow vpn audible").
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...
Brave Mobile browser allows turning on background video audio thus eliminating the need for YouTube Premium and similar subscriptions.
For Firefox:
https://github.com/mozilla/video-bg-play
This works great, thank you.
For others: Settings > Media > Enable Background Audio
New Pipe X if you need a full client does that as well.
I know of NewPipe (Android) but can't find anything about New Pipe X
https://github.com/NewPipeX/NewPipeX
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).
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.
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.
You might be interested in GrayJay app.
It's a really cool idea for an app. Pity that Google takes down the videos where Rossman talks about it.
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.
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.
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
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?
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.
Apparently this isn't stopping the yt-dlp people.
I am using the GUI version on windows https://oleksis.github.io/youtube-dl-gui/
Yeah, yt-dlp is the successor. I've been using it for years.
> 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...
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.
Me too, i don't enjoy observing people's pimples on the nose
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".
Interesting, I don't use premium but is there a reason membership only videos don't support background audio? Seems like a weird exclusion
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.
Or just switch FFA to desktop mode.
That works fine without any extensions at all, so I'm unsure what does the extension even does?
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.
A service that takes arbitrary user input and then attempts to download/proxy whatever is at the end of that input. Brave soul.
One of my last weekend projects was something similar: convert youtube playlists into podcast-compstible URLs:
https://github.com/cquintana92/yt2pc
NewPipe can do this very nicely, it even lets you build a playlist of videos.
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.
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
Direct to mp3 doesn't expose all the encoding options one may want.
you're unnecessarily making huge assumptions. Some people don't want the bestaudio or mp3
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.
separate from above - willing to share your config anyways? I love me some yt-dlp configurations
> then run it through ffmpeg to convert to mp3.
> Some people don't want [...] mp3
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.
MP3 is accepted by far more players.
Do you have examples of this that aren't 20+ years old?
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.
Which players only accept mp3? Maybe this was true in the early 2000s
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.
But why not just download the mp3 then?
From where?
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.
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.
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.
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.
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/
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.
YouTube doesn’t encrypt the media stream other than TLS. Decoding the video can be skipped though.
I think it's -x to just rip audio now
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
mpv similarly has this option. I listen to far more videos than I watch.
<https://mpv.io/>
MPV is just passing the stream selection arguments over to youtube-dl/yt-dlp.
Sure, and you can set that directly in your mpv config:
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.
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.
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).
It seems they do not want you to report an issue without an accompanying fix for it.
> If you would like to report a problem you find when using you-get, please open a Pull Request, which should include [snip]
Can't say I've encountered this before.
As the other commenter said, they want a failing test, not a fix.
"Addressing" is probably a bad word to use here. "Demonstrating" would have been better, IMO.the most expensive piece of writing software is scoping work.
i’m almost tempted to add a test suite just to give people more agency over my output because right now i’m only soliciting feedback in person to cut down on internet bullshit, like what happened to xz-utils
The Chinese version of the text has an extra header line that translates to "to prevent abuse via GitHub Issues, we are not accepting general issues". An earlier commit has this for the English text:
https://github.com/soimort/you-get/commit/75b44b83826b3c2d9a...Maybe they got too much spam.
By the way, `tests/test.py` seems to just run the extractors against various websites directly. I can't find where it's mocking out network requests and replies. Maybe this is to simplify the process for people creating pull requests?
I can get this, but I aggressively report accounts and issues. I'm not sure how GitHub handles them but they seem to not come back.
Though what I'm unsure how to deal with is legitimate users being idiotic. For example, recently one issue was opened that asked where the source code was. Not only was there a directory named "src" but there were some links in the readme to specific parts. While I do appreciate GitHub and places like hugging face [0], there are a lot of very aggressive and demanding noobs.
I'd like ways to handle them better.... I'm tired of people yelling at me because 5 year old research code no longer works out of the box or because you've never touched code before.
[0] check any hugging face issue and you'll see far more spam. Same accounts will open multiple issues that just barate owners and hugging face makes it difficult to report these accounts.
The solution is to ignore them and close their issue. Open source maintainers have enough to worry about and are unpaid, it's okay to be a little dictatorial when it comes to "bad questions".
That's not a solution.
It addresses the specific issue but does nothing to prevent future similar issues. A solution to a cold is not handing someone a tissue.
I like that these platforms are open to everyone but at the same time there are a lot of people who have no business participating. Being able to filter those people out is unfortunately a necessary tool to not get overloaded.
Worse, I find that due to this many open source maintainers and up being quick to close issues and say rtfm. I can't tell you how many times I've had this happen where in my opening issue I quote the fm and even include a reproducible test. It's also common to just close and say "not our problem".
Kind of makes sense, it weeds out all of the people who didn't read the manual.
They want you to just submit a PR with a test that, if passed, would indicate the problem for you is fixed.
I kind of like this. It's a more formal proof of concept. You prove the bug exists by writing a failing test. If they cannot construct a failing test then it's either too hard to mock or reproduce (and therefore maybe not even worth fixing, for a free tool), or it's impossible because it's not a bug. Frees up maintainer time from dealing with reports that aren't bugs.
> If they cannot construct a failing test then it's either too hard to mock or reproduce (…), or it's impossible because it's not a bug.
Or, you know, the user is not a developer. Or is unfamiliar with Python, or their test suite, or git, or…
It is perfectly possible to be good at reporting bugs but be incapable of submitting pull requests.
The problem with popular tools is that they have more bugs that can be fixed. So bug reports are pretty much worthless: You know that there are 1000 bugs out there, but you only have resources to fix 10 of them.
By asking users to provide reproducible test cases, you can massively reduce the amount of work you have to do. Of course that means 90% of bugs will never be reported. But since you don't have the resources to fix them anyway, why not just focus on the bugs that can be reproduced and come with a test case...
I don't think it's necessarily about fixing those bugs, but I think a lot of times it's more about at least having those bugs be documented in order to raise awareness on (probable) issues down the line for whoever would want to use that project in the future.
You missed the point entirely.
It’s your prerogative if and how you want to limit the amount of people who can contribute, but I was explicitly replying to someone claiming that a person’s inability to code is in any way related to the validity or importance of the bug.
What happens if you don’t know Python? Python is a relatively easy language to learn but no way I’m gonna learn Python just to report an issue
Did you (or anyone) in this thread look to see exactly what they are looking for with their provided examples?
https://github.com/soimort/you-get/pull/2680/commits/313b8d2...
You do not need to know Python deeply to construct what they are expecting. They’re not actually looking for a unit test or something.
> Did you (or anyone) in this thread look to see exactly what they are looking for with their provided examples?
I did. And I looked at all examples of “good commits”, not just the trivial ones.
https://github.com/soimort/you-get/pull/2685/files
That’s already complex for someone unfamiliar with the software (which might nonetheless be able to open a competent bug report).
Then you don’t get to contribute bug reports.
Perfectly fine rule for a maintainer to have.
If the bug is egregious enough, somebody else will find it. If the bug is important enough to you but esoteric, then ask on a forum or enlist the help of someone you know who does know Python.
How do you currently submit bug reports on e.g. MS Word or Adobe Photoshop? This way is certainly more open than those commonly-deployed software.
Good chance you wouldn't be writing good bug reports either, then. Github issues have enough noise that a first-pass filter like this feels like a good idea, even if it has some false positives.
This in no way aligns with reality. I frequently interact with users who can’t code at all but make good bug reports. One of the best ways to ensure success is to have a form (GitHub allows creating those) which describe exactly what is necessary and guide people in the right direction.
What you're saying is even worse, since you’re implying someone could be an expert computer programmer or power user, but because they’re unfamiliar with the specific language this project chose, they are incapable of making good bug reports. That makes no sense.
I fail to see the logic in your comment. Just another case of Goodhart's law.
This isn't really a metric though. It's a formal existence proof that the bug exists. The key difference IMO is that you have to create a test which A) looks (to the maintainer) like it should pass, while simultaneously B) not passing. It's much harder to game.
There are other cases where Goodharts Law fails as well: consider quant firms, where the "metric" used to judge a trader is basically how much money you pull in. Seems to be working fine for them
If you can’t describe your bug in a test, then you probably can’t describe it sufficiently in English either.
Seems to make sense
The same thing that happens if the author of the OSS you use doesn't know English.
That's exactly it. They put up a gate that blocks low-effort issues that only add busywork. I like it!
Interesting. I like the idea of encouraging people to try creating a test or even a whole fix, but saying that’s all you will accept is a bit much. On the other hand, I’m not doing the work to maintain you-get. I don’t know what they deal with. This may be an effective way to filter a flood of repetitive issues from people who don’t know how to run a command line program.
I believe there are two extremes. On one end you get a bunch of repetitive non-issues, while on the other end you only get issues about (say) bugs in FreeBSD 13.3 because only hard-core users have the skills and patience to follow THE PROCESS.
I know how to make an isolated virtual environment, install the package, make a fork, create a test and make a PR. But I don't know whether I care enough about a random project to actually do it.
It’s relatively easy to write a failing test and it massively cuts down the work related to moderating issues. Also, reduces the danger of github issues turning into a support forum.
If this results in the project being easier to maintain and being maintained longer, then I’m fine with this.
> It’s relatively easy to write a failing test and it massively cuts down the work related to moderating issues.
Relative to what? Learning someone else's code base well enough to write a useful test is not trivial.
It's not a bad method, but the vast majority of users won't be capable of writing a test that encapsulates their issue.
In the case of this tool, adding a failing test case looks trivial if you've got the URL of a page it fails on.
Provided the maintainer is willing to provide some minimal guidance to issue reporters who lack the necessary know-how, it even seems like a clever back door way of helping people learn to contribute to open source.
Serverspec does the same: https://github.com/mizzy/serverspec?tab=readme-ov-file#maint...
Anybody else getting this error constantly?
Tried with debug flag but didn't really help I was curious to see if it can bypass age restriction (though I tried on non-age-restricted video too with the same error).Same error, not work at all.
Check your Python version.
Try switching to the newest version of Python with something like Pyenv, or even try spinning up a Docker image with something like:
docker run -it -v $(pwd):/mnt python:3.13 bash
...and try using the utility there. Good luck!
Given the title and the first few sentences from a description I assumed that it's some heuristic-based tool to try and grab whatever there is on the page, which would be useful if there's no tool which implemented the support for this site (which in most cases just means "yt-dlp doesn't support it"). But apparently it's also extractor-based with a separate extractor for each somewhat-popular source. So, basically it's just less sophisticated clone of yt-dlp?
I wouldn't exactly call a ytdl-style media downloader with a whole library of site-specific extractors and converters "dumb" but still cool that more projects like ytdl exist.
Can someone explain why this is better than yt-dlp
That's an interesting question. They only depend on a single library, but I wonder how much code is really their own. I found it curious, for example, that there is a dedicated mp4 joiner (I mean, if you already have ffmpeg, there is probably no way you can do it better yourself).
https://github.com/soimort/you-get/blob/develop/src/you_get/...
That is interesting, huh, yeah they list ffmpeg as a dependency so I wonder what that didn’t cover for them.
Though there are some cases where using pure ffmpeg is just to difficult or impossible. Recently i had such a case where I wanted to merge multiple video files from my GoPro (they come out in 4GB parts if the video is longer than that), but while keeping / correctly merging all metadata such as date / accelerometer / gps / any custom binary streams. Ended up using this and worked great https://github.com/gyroflow/mp4-merge
How did you infer better than yt-dlp? I think the more the better when it comes to this space as google fights back.
But some information what the differences to ytdlp are and what the reasons for starting an entirely new project were, would still be helpful.
(Also, a multitude of tools isn't really all that helpful if they all stop working in the same instant because they all relied on the same APIs etc)
> starting an entirely new project were
The project was started in 2012, long before yt-dlp (but not before youtube-dl)
I’m not sure I understand why Bandcamp is on the list of supported sites: they allow you to just download the files on the condition you first pay the artist for them.
The fact you can download it with this tool is because the artist is letting you listen to it for free before buying it. Downloading it with this tool seems totally unnecessary and a bit of a jerk move. Bandcamp hosts mostly small and independent artists and labels.
Their list of supported sites isn't a declaration of where you should use this tool for moralistic reasons. It's just a list of popular sites it works on.
I presume you could subscribe and still use this tool? People use automation tools like this to download things that they already pay for because it saves them the effort of logging into 5 different apps depending on which walled garden it's in.
It’s Bandcamp: you buy the album and they give you a link to download it in whatever format you want so you can listen to it using whatever app or device you wish. You can come back later and download it as many times as you like.
What if I don't want to manually follow links or "come back later", but just add the album I purchased to the config for the same script I use for the rest of my media library?
Do artists get paid on Bandcamp if they bypass the login?
Personal assumption, but probably not everyone lives in a country where they can pay Bandcamp.
And from personal experience I can say, sometimes people want or have to consume media offline, because of unreliable or slow network or expensive providers. But this doesn't mean that they won't pay later if they like it.
At what income level do pirates consider it immoral/moral to pirate something?
Different pirates have different moral codes regarding piracy; there is no standard.
Personally, I consider it immoral to pirate Windows without a very good reason (which doesn't include "I like using Windows", or "I want to play game X" or "I want to use the enterprise version which doesn't have baked-in ads").
It's probably an inverse of non-pirates who consider it a moral obligation to pay for a digital copy of something that does not diminish or remove the original
Not all of us agree that artists should charge for their products.
That gives you the right to be an artist and not charge for your own products, not the right to steal from other artists who have differing beliefs.
There are reasonable moral arguments against copyright infringement, but the false equivocation with stealing is not one of them.
The same moral principles that argue against depriving people of natural property they already own do not imply further arguments against reducing sales opportunities for non-rival goods for which scarcity has been artificially established via positive law. Other, unrelated principles, can make for compelling arguments, but not the same ones.
Not everyone agrees supermarkets should charge for groceries.
Most people do, since groceries are physical, rival goods to which natural property rights apply. But if it were possible to make copies of groceries while leaving the originals intact, far fewer people would argue against that on the same grounds. They might make other, unrelated arguments against copying, but moral principles applicable to physical property wouldn't be relevant.
https://web.archive.org/web/20060201064815/https://www.wired...
I love Spain. They know how to do anarchy.
It is interesting that the rebellion against consumer capitalism is more consumption.
> Search on Google Videos and download > $ you-get "Richard Stallman eats"
I don't often read instruction manuals, but this time I did and I found this gross easter egg
oh god
Nice work. But as a consumer, Why should I use you-get over yt-dlp? What are its strengths over yt-dlp, which works quiet well on a huge range of websites[1]
[1] https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites....
I like this. I am imagining a companion extension for chrome/ff that uses you-get as a backend to implement it in a seamless way. Forward thinking idea: imagine going on youtube and have you-get extension bypass the youtube player and playing the content directly without ads. When I say youtube I might also say any other platform.
Sounds like FastStream Video Player
https://addons.mozilla.org/en-US/firefox/addon/faststream/?u...
Can it back up a text webpage? Can it remove popups for newsletters, or subscription, or logins, or cookies' notifications? Can it read pages that require signing in?
Is this just a fork of yet-dlp with credits rewritten?
Why not diff the code bases and find out?
Too hard, I was hoping you would do it.
the project appears to have an inaccurate description. perhaps it is the long-term goal, but today it behaves more or less like a subset of what yt-dlp does.
there is some polish to the interface, so it might still be worth trying out if it does what you need it for.
How you get over the login barriers for youtube?
Another library released which lies about what it is to circumvent anti-bot security.
Let's just not act surprised when tighter attestation comes in effect.
A future in which YouTube will refuse to stream you data because you didn't pass client attestation is definitely coming and I wish we could stop it.
It is a dark future where some of us will accept it, and rest of us will be constantly taking part in a cat-mouse chase in which we glitch out attestation tokens from vulnerable devices to get by.
We need laws against user-agent discrimination.
Can you describe in a little more detail what exactly client attestation is, and why you would need other devices to achieve it?
Client attestation is a mechanism for servers to get cryptographic proof from a client about what software the client is running. Modified browsers, or software like yt-dlp, would have a harder time providing such proof. How hard a time would depend on the security hardening of the attestation mechanism. It'd almost certainly be broken, just as most attempts at DRM get broken, but it would be one more speedbump.
There are legitimate purposes for attestation; for instance, server attestation can allow a user to run software on a server and know that software matches a specific build and hasn't been subverted, so that the client can trust the server to do computation on the client's behalf.
But one of the leading uses of client attestation is DRM.
This library/program solves problems that people have with pages like youtube... too many ads, no way to download videos for offline use (or archive for when they get removed), and better performance with a native player.
If I was forced to watch all the ads on youtube, i wouldn't watch videos there at all.
I get it. But I don't.
For YouTube you can pay for premium.
Consuming not only their resources but also their incredible streaming algorithm for free is just a dirty move.
Doing this just puts you into the statistic of bad users that incentives companies like Google to push more intrusive DRM. Which at the end of the day makes us all suffer.
Good luck finding an alternative by the way.
And I consider them bad advertisers and just don't care.
We had the internet without ads. Then we had the internet with small banner ads, that didn't track users but were there because of the page content. Then those ads moved from text/image to animated gif, and they became annoying. Then flash was used and it became a security concern. Then the number of ads went up and up, video was introduced, autoplaying, with audio, and at some point most of the internet is unusable without an adblock. It's not something we, the users, wanted, the advertisers (google included) made the internet unusable without an adblock, and that includes 3 25 second ads on a 1m20s video on youtube.
If advertisers returned to non-animated banners above/below the video, we wouldn't have to install adblocks everywhere anymore, and people would see the ad without wanting to kill the advertiser for bad intrusive advertising practices.
They started it, they went too far, we're just reacting to what they're doing. And as we've seen with other platforms, even paying for premium doesn't mean no-ads. And still an adblock is needed to remove the in-video ads ("this video is sponsored by shadow vpn audible").
I used to "save" interesting links by emailing them to myself.
Now most of them are dead, twitter accounts removed, youtube videos deleted, facebook pages bought by media management companies, sites rebuilt etc.
Whatever the primary goal if this tool, it, and other similar tools, are invaluable in actually saving and preserving content
Anti-bot is just a lied to block real human users you don't like/care about. Bots don't work for themselves.
this different from JDownloader2?