Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What's the Situation with YouTube-Dl?
97 points by tjrgergw on Aug 26, 2023 | hide | past | favorite | 68 comments
I wanted to download some lectures [1] off youtube as I'm going to be without internet or a long period, and but A) just apt install get me a version which is too old, and I get ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. and B) going to the update url I see Access denied; Due to a ruling of the Hamburg Regional Court, access to this website is blocked.

So, what's the situation with youtube-dl? How do I get it working? As a separate question, how else can I download something off youtube?

I guess last resort I'll have to dig into the python to figure out why that regex is failing and what else I can do about it, but that's not sustainable.

[1] if anyone is curious, just discovered this from HN: https://www.youtube.com/watch?v=tNOu-SEacNU&list=PLDcUM9US4XdPz-KxHM4XHt7uUVGWWVSus&index=5




Just get the standalone yt-dlp from github and occasionally update it with yt-dlp -U since Google constantly tries to interfere with the download mechanism.


Indeed, "eska!"

& Here are the two (most widely known-to-date) ports of "youtube-dl": "yt-dlp" and "youtube-dlc"

However; in order to avoid any issues. For both, you're gunna want to completely uninstall "youtube-dl" and remove any remnants of it from your system.

To do so, For those using Linux, start by removing the "/usr/local/bin/youtube-dl" directory; Then, if found on your system, remove "/etc/youtube-dl" too.

For those using Windows, uninstall "youtube-dl" entirely by removing the "youtube-dl" directory found in your "\Program Files\" folder, manually using explorer or via the command prompt. (Or which ever directory that your installer or build had previously installed "youtube-dl" to).

Finally, now you may being your journey--to the PROMISE LAND!

DANIEL SON!

Go ahead and now install one of the following "youtube-dl" ports (Installation instructions are included in the documentation provided by both forks)

I) https://github.com/blackjack4494/yt-dlc & II) https://github.com/yt-dlp/yt-dlp

Cheers! x()x()__@zyp.LOL__O.o


hehe, you mean "Daniel-san", like from The Karate Kid?


Sure, if you wanted to spell it right. But if you want North-Easterners to say it right, then it's Daniel-son


I have an alias to pop a nix-shell -p yt-dlp pointed at nixpkgs master.


You can use youtube-dlp: https://github.com/yt-dlp/yt-dlp its an activ maintained fork


Right, I found that in the subreddit, and furthermore here's release files

https://github.com/yt-dlp/yt-dlp#release-files

I downloaded the release binary for linux, and it's downloading now.

Thank you.


youtube-dlc is not maintained.

youtube-dl is not maintained but not very active because is stable.

yt-dlp uses youtube-dl as a core, so if something breaks still needs to go to the youtube-dl and fix it.


> yt-dlp uses youtube-dl as a core, so if something breaks still needs to go to the youtube-dl and fix it.

No, they don't. yt-dlp is a fork - if something break, they can just fix it in their own codebase without needing to go through yt-dl. yt-dl is still somewhat active, but almost all their commits are backports of fixes from yt-dlp[0].

[0]: https://github.com/ytdl-org/youtube-dl/commits/master/


yt-dlp is not dependent on youtube-dl. yt-dlp is simply a fork of youtube-dl that happened some years ago due to the maintainer of youtube-dl refusing any updates that would break compatibility with python 2. yt-dlp has since been the most active youtube downloader repo on github with pretty much daily commits and instant fixes when changes to youtube happen.


It looks to me like apt might be a poor fit for a package like youtube-dl - unless I'm reading this wrong it looks like the packaged version is a couple of years out of date: https://packages.ubuntu.com/lunar/youtube-dl

Due to its nature something like youtube-dl needs to be constantly updated, as it's scraping websites that are constantly changing. So best to install it through other mechanisms like pip instead.


this is one of the very few apps where i don't even bother to install a distribution package. since it is a single script it is not difficult to install anyways. just download, run, and update occasionally.


This is a microcosm of my experience with Ubuntu.

Install something with apt, run into an issue... Oh, the version is ancient, and its fixed in official releases.

Then my options are:

- Fight with apt/.deb packaging and try to roll it forward, maybe breaking my system.

- Figure out how to compile it from source, and manually integrate it until its kinda like the system package.


This is my experience with any linux distro I've used, I'd prefer a smaller, regularly updated repository instead of my (2023) distro being shipped with ancient versions of, e.g. node, python, openssl, etc...


> oh this version is ... Full stop.

The weird contradiction is that you would have a better impression if things just stopped there.

E.g. the most current release on windows is broken. You grumble and give up. Heck, for apple stuff you would probably give up before even thinking of trying to fix anything.

As far as users are concerned, linux would be better if it simply said "No!" more often.

The fact that you treat "fighting" and "compiling" as options and then complain about it being tedious already shows a bad image. All other OSs simply say "Nope. Tough luck" and you are happier for it.


> ... current release on windows is broken ... You grumble and give up

No, you just scroll further down on the GitHub releases page (or whatever) and grab an older version that does work, same as every other platform.

For yt-dlp in particular, on a recent x64 or ARM64 kernel you could grab the precompiled Linux binaries and skip the compile the same way, if you wanted. They ship self-contained static linked binaries on Linux.


This software is written in Python. You don't have to compile it.


Yes, I know; they use pyinstaller to distribute binaries. You can get the source but setting up a working Python environment is the same problem that OP is complaining about; they don't want to do that. You can avoid it by taking the self-contained release build just like Windows users do. yt-dlp does a really great job on this.


Compilation isnt really my issue on linux, is more that I have to go and dig through how to set up the project rather than just use it (like you would from a distro package).

Maybe I have to install some prerequisites, maybe I need to set nonstandard specific environment variables and paths, maybe I need a specific version of a library, maybe I need to edit a make file...

This is fine for a few programs, but the annoyance really adds up when it happens repeatedly.


On Archlinux that problem doesn't exist, everything is a recent release


Hence I am running CachyOS on desktop, and Clear Linux on a little server :P

I don't mind Ubuntu as much on servers, as stuff is often done through containers or manual downloads anyway, and its not as prone to breakage as desktop software.


Or there’s an AUR -git equivalent


Or you can create one yourself by writing a short pkgbuukd file


Unironically, using Gentoo resolves this. If a package isn't up to date, you can rather easily define a new up-to-date package.


A CLI tool is something trivial to get from Nixpkgs since greater integration with OS’s GUI isn’t required.


Why not become (or help) the Debian packager of youtube-dl? Debian packaging is not especially difficult and the whole thing runs on volunteers. You don't have a right to demand that Debian or Ubuntu keep particular packages up to date.


Even if I did, I'm not sure that would be possible? I thought the idea was to ship stable versions of packages for each major release.


yt-dlp, in particular, provides static linked binaries for Linux x64 and ARM64. You can just download the latest binary off their GitHub releases page. It's a breath of fresh air.


What about docker? Seems perfect for this. Something like 'docker run youtubedl ... ' https://hub.docker.com/r/mikenye/youtube-dl etc.


Docker for things like this always feels like such an overkill to me


For those on macOS, if you use homebrew to install the latest version of yt-dlp you can download the whole playlist provided above without any issues.


Confirming this, as it’s what I use.


The last time I checked, youtube-dl and yt-dlp can both be obtained via (Python) pip. To my knowledge, these will be the latest releases.


About youtube-dl, I think the version in pip is about a year old. For now the best way is to get the code and build it (which is just to run `make`)


I have found that using YTDLP, (a fork of YT-DL) with no throttling works flawlessly.

I recommend using a frontend: https://www.reddit.com/r/youtubedl/wiki/info-guis/#wiki_gui.... GUIs can be better in this situation since they show you all the cmd line options like -embed-metadata, -embed-chapters, and show you all the resolutions you can download at, I would really checkout a frontend if you plan to download multiple files or a playlist


Searching reddit I found a subreddit: https://old.reddit.com/r/youtubedl/

Man google sucks.


It doesn't suck, it's been destroyed for the sake of control.


yt-dlp/youtube-dl depends on APIs defined by Google. Those APIs can be changed at any point in time, so I’m not sure it’s sensible to include this package in Debian stable, where packages aren’t expected to change often.

Glad to hear you found a newer version!


As discussed recently[1], Debian provides yt-dlp in backports[2].

1. https://news.ycombinator.com/item?id=37211579

2. https://packages.debian.org/stable-backports/yt-dlp


Just downloaded a bunch of things last night. My approach is typically using docker. Considering the rate at which a version has failures/low-bandwidth, I don't bother installing it on my host system:

`docker run -it --name ubuntu-mantic -v path/to/your/videodir/:/VideosDir ubuntu:mantic /bin/bash`

Install stuff needed on the container, typically curl python3 etc and the install from GitHub: https://github.com/yt-dlp/yt-dlp/wiki/Installation

and you're good to go. I've honestly found this easier than fighting with my host system and constantly reinstalling broken versions etc.


The best way is to download the source from github, run `make`, and copy the the file to $HOME/bin . There hasn't been a release for about a year now and the files on the distro repos are even older (I think).

Also YouTube has been doing some changes lately on the the player and a lot of the tools fail to download audio or video.

For example, in the last couple of weeks there have been some issues with a redirect to a 'consent page' : https://github.com/ytdl-org/youtube-dl/issues/32499


As a last resort, you could try https://yt5s.io/en90. It worked for me every time I had to download something.


this link doesn't work


It works for me. Where are you located?


It "works" in the sense that it doesn't 404, but says "Our service has been discontinued as of February 26, 2023.".


For about a year its hasn't updated the expired token, yt-dlp has been forked out of it by the community to provide a continuous support.


yt-dlp is its successor, but I'm having a lot of trouble with it too.

I've been having more success with JDownloader2.


i installed `yt-dlp` once with:

    $ wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp && chmod +x yt-dlp && mv yt-dlp "$HOME/bin/"
(actually this command is in my "install script" that i run when i install a new distro)

when something doesn't work, i run `yt-dlp -U` and 8 times out of 10 it automatically upgrades itself to a new version with the fix, if it still doesn't work i wait a few days and usually the fix arrives :)

note: `$HOME/bin` comes first in my `$PATH` so that programs like `mpv` always uses the newer version of `yt-dlp` and not the obsolete version installed by the package manager.


One popular hack to download files manually in the browser is to replace "youtube" in the URL with "ssyoutube". It redirects you to another website which has the download option


use pip install not apt


Open Video Downloader works for me, manual installation of ffmpeg may be required though.


YouTube Downloader works fine.


As a last resort, you could subscribe to YouTube Premium, which allows you to download the content.

I don't mind paying for ad-free content.


Where you “download” videos and they reach into your device and wipe them from your phone’s file system when they’re removed from YT.


it isn't a real download, because you don't have access to the raw file.


It solves OP's problem. Why is that bad?


This is going to sound mean, but I don't intend it that way. But a clear question calls for a clear answer.

The reason why your solution is bad is because your solution only solves the problem for certain imagined values of 'problem'.

We don't know what the playback user story is for OP -- is it a raspberry pi? is it a librem 5? -- and there's no way to know that the user's problem is in fact solved, as you claim.

Your solution makes assumptions, and there's no way to know if they're reasonable, because this is HN, not Best Buy, and some of us are on some pretty interesting (and DRM-free) hardware. That's why it's bad.


My comment started with "As a last resort...", meaning if none of the DL scripts worked for him/her. I didn't advocate Premium as the primary solution.


Does YT Premium work offline? The OP says they will be going without internet which is why they need to download them.


Yeah with Premium downloaded videos can be watched offline, but you need to connect to the internet every 30 days.

It’s a nice no-fuss solution if you just want to watch some videos offline (as mentioned, it’s not suitable for archival) and the device is iOS/Android.


I think I'd prefer to have the plain video file.


Can you confirm if the end cards overlays that ruin music videos and other short films go away if you pay for premium? Are there any of the other annoying overlays still active?

I prefer yt-dlp downloaded videos mainly because you get to actually see the complete videos without overlays…


I can confirm I don't get any overlays on the two videos I downloaded.


I use yt-dlp primarily not for download, but for playing/streaming Youtube videos directly in media player (mpv) instead of browser.

Does YouTube Premium help with that?


Out of interest why do you do this? Because your computer struggles to play them in browser? I was doing something similar with vlc in the Flash era because I couldn’t run Flash on my PowerPC Mac running Linux


I do this because it lets me have each video in its own resizeable window, scrub around much more quickly using keyboard/mouse shortcuts, customize many aspects of playback like subtitle styling ,brightness, hue, even flip or rotate the video if I want, set the volume on a per-video basis even >100%, save exactly where I was in a video and how it was set up, not have every video I see a part of show up in my history (even hovering for preview does that now, annoyingly), and install a multitude of plugins to augment the player even further.

Though, I initially did start using mpv for watching videos back in 2014 when I was stuck with a core2duo laptop, and it was the only way of watching 720p or higher video without slowing the machine to a crawl. I'm so used to this setup now that I wouldn't want to go back to having my videos trapped a browser tab. (or an always-on-top firefox popout window)


Several reasons:

- Until recently, Firefox did not support VA-API video acceleration on Linux, while mpv supported it for a long time. My last computer struggled to play 1080p videos without hardware acceleration.

- I am used to mpv keybindings, i do not want to use two completely different sets of keybindings for playing local videos and Youtube.

- I like videos in a separate window (this feature Firefox started to support recently as PiP mode).


I doubt it. The videos are downloaded, but not readily accessible to other applications. But I don't have your workflow, so I've never investigated.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: