Hacker News new | ask | show | jobs
by probably_wrong 1163 days ago
For the sake of testing, I just downloaded youtube-dl from Github [1]. I then tried to run the program, but it failed with:

   /usr/bin/env: ‘python’: No such file or directory
Okay, the script can't deal with "python" vs "python3", whatever - I'll change the script's first line and move on. Next attempt:

   $ youtube-dl https://www.youtube.com/watch?v=5pV8WFvSNYE
   [youtube] 5pV8WFvSNYE: Downloading webpage
   ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
I knew I would get this error because I got it two weeks ago already. And considering that the version number is `2021.12.17` that looks suspiciously close to a dead project, or at least for a project whose very description is "download videos from youtube.com or other video platforms".

Edit: I went through the repo and found that this bug has been reported two months ago [2]. I understand that the project is not dead in the sense that they are still looking at bugs, but if a major feature is not working for two months now then I think it's reasonable for people's faith in the project's future to be shaken.

[1] https://github.com/ytdl-org/youtube-dl#installation

[2] https://github.com/ytdl-org/youtube-dl/issues/31530

2 comments

> /usr/bin/env: ‘python’: No such file or directory

Your install is not configured properly. This is a googleable fix. (One example is to use `which python3` as part of your command https://stackoverflow.com/a/73610228)

> ERROR: Unable to extract uploader id;

This is a known bug and already has a fix but has not been packaged or released for youtube-dl but you can fix it yourself or use a different pacakge. https://github.com/ytdl-org/youtube-dl/issues/31530

Now in the first week of this issue I half recall the line in the code was pointed out, (possibly it's the one that's now being claimed as not a good fix still listed in the above) in one of the many people reporting the bug, with that being all that needed to be changed ... I didn't feel like at the time, grabbing the source, finding the offending line, and then compile it and besides there would probably be a working binary fix available for download that might have resolved a few other issues. I'd been following along every few days to a week to see there were any links to working forks compatible with older gear ...

That link above as it is presently ... issues/31530 ... lists the following as the fix, below - https://github.com/ytdl-org/youtube-dl/issues/31530#issuecom...

Now my problem is I'm not running Win 13 or the latest linux distro but still I have the best up to date browser I've yet to find that runs on my old system ... and that link does nothing ... if I put the link in another it simply opens back at the top of the parent.

I figure I could copy every recent file one by one from the git repo and play at fooling with my own, but since someone commenting on this topic actually compiled the given source - only to land some old 2021 problem - sigh.

Now I have flipped though what I see in the above ... no fix info ... fucked and bye bye time. The next option touted as the fix sadly does not run on my old system, it could work with the online server but ... how long until ...

It is of course easier for people like me who are no longer or were ever competent programmers, let alone being well versed in python, to pick some other program - I've been told such as IDM will handle youtube antics fine as well as being compatible with older systems, so it may well be worthwhile to purchase a copy.

Oh well youtube-dl .. thanks for the fish.

I can't follow this post very well. yt-dlp I think has this fixed. There is also ways to fix this without having to download youtube-dl file by file as you mention. (see this: https://stackoverflow.com/a/55562973 as a single example) there are are many easy ways to get around this issue. You can do it! Good luck.
Thanks. Unless you're inferring it works in interactive mode, I'll take it as a guide to rebuilding youtube-dl. Is there a link with all the updates in one pack or do I have to create a github account to gain access? Other than that, as an outline of a fix, the stackoverflow link as a solution seems vague to me.

There's a reply made to the current thread here which, to me anyhow, means the listed full source code at github has not been updated.

There are updated individual components - however it's been in the order of 16 years I've decompiled and adjusted and recompiled. It might be worth the effort ... if only youtube-dl was going to keep on sailing onwards. The nah moving to something else commentary informs me that sooner or later updates will probably get slower until such point people won't bother reporting issues - better for my old system to make the move sooner rather than later.

yt -dlp is probably relevant to the cheap online server I use with the latest python installed. I generally didn't use youtube-dl on it, unless the download was going to take some time and better to let the server accumulate it over a few hours. yt-dlp supposedly fixes the trick youtube used to try and discourage cli downloaders.

I think if you have python installed but no 'python' executable in PATH, your install is broken.
That depends on who "you" are. Linux distros these days tend to ship modern python package with a python3 executable, no python executable. Many distros still support a python2 package, some install that as a python exeutable, some as a python2 executable.

iirc. homebrew on OSX installs python as a python3 executable, no python exeutable.

Hopefully no-one should support python v2 in 2023 ?

AFAIK, at least Arch symlinks python to be python3

    $ file /usr/bin/python
    /usr/bin/python: symbolic link to python3
I think this is by default, I don't remember doing anything special in my setup. `python2` exists for packages still needing python 2.7 et al.
Arch doing this is what fucked it up for everyone else!
Fedora does the same. Must have been 3 or 4 years ago Python 2 was removed as a dependency from the core system packages and "python" started resolving to a Python 3 release.

I expect this has filtered down to RHEL9 now.

Multiple version are supported with "python2.7", "python3.9" etc. if a version older than the current default is required.

Hah, sorry? If you don't use, you shouldn't be impacted by the decisions Arch does :) Unless I'm missing that you were joking.
There are people who write programs on Arch that use the python3 -> python symlink.

Then when that program is packaged for other distros, you get this error.

Not a huge deal by any means, but the non-standard behavior can add a bit of friction.

Yup. For example, debian based distro users need to install this [1] to make python be python 3.

[1] https://packages.debian.org/bullseye/python-is-python3

Varies by distro. On Gentoo a python binary exists.
Expecting python3 to be available as 'python' means that _your_ install is broken (until the time when python3 re-implements all the syntax and semantics and stdlib of Python 2.7 so that code may run unmodified).
No the issue is that python on its own meant python2 for a long time and there are still distributions still using python2

I you need python3 the you need to put python3 in the shebang

Relying on `python` being compatible with whatever python version your scripts target is foolish.