How to install *latest* yt-dlp on Ubuntu Server 24.04.1 LTS?
Keith
keithw at caramail.com
Tue Feb 11 17:37:10 UTC 2025
On 2/11/25 1:48 AM, Bo Berglund wrote:
> On Mon, 10 Feb 2025 15:38:19 -0600, Keith via ubuntu-users
> <ubuntu-users at lists.ubuntu.com> wrote:
>
>>> I don't understand this explanation but wonder what I could do now that the
>>> cook-book command did not work?
>>>
>>> And I have never programmed in python so I don't know how that is done either.
>>>
>>>
>>
>> Unless you're wanting to gain experience with installing python programs
>> in a python virtual environment (there's plenty of howto's for that),
>> I'd forgo doing that and either download the yt-dlp static binary and
>> stick it in /usr/local/bin:
>>
>> https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux
>>
>
> Thanks,
> what happens if I do the following to get it into my own bin dir instead:
>
> cd $HOME/bin
> wget https://github.com/yt-dlp/yt-dlp/releases/download/2025.01.26/yt-dlp_linux
> mv yt-dlp_linux yt-dlp
> chmod +x yt-dlp
>
> I will now have the file under the correct name and in my own $HOME environment,
> but will it have the necessary environment present so it can run properly?
> I have seen that when installing from apt there are lots of other stuff that
> comes along...
That's the advantage/disadvantage of static binaries, most everything it
needs (python environment mostly in this case) is compiled into the
binary. The size of the yt-dlp_linux static binary is 34M. The size of
the yt-dlp python script provided in the yt-dlp apt package is 205
bytes. Apt is pulling all the other packages needed to run the script.
>
> However, after doing the above but into a dir in my $HOME/ and symlinking to
> $HOME/bin/yt-dlp I tried it by checking the version and that is what I need:
> 2025.01.26
>
> But still the result was a no-go:
See my response in my reply to your next message.
>
>
> $ yt-dlp -o HP-keyboard.mp4 https://youtu.be/gYRDjLb41R8
> [youtube] Extracting URL: https://youtu.be/gYRDjLb41R8
> [youtube] gYRDjLb41R8: Downloading webpage
> [youtube] gYRDjLb41R8: Downloading ios player API JSON
> [youtube] gYRDjLb41R8: Downloading android player API JSON
> [youtube] gYRDjLb41R8: Downloading player 9c6dfc4a
> WARNING: [youtube] gYRDjLb41R8: nsig extraction failed: You may experience
> throttling for some formats
> n = a-kRtl8v40CZFsFQ ; player =
> https://www.youtube.com/s/player/9c6dfc4a/player_ias.vflset/en_US/base.js
> WARNING: [youtube] gYRDjLb41R8: nsig extraction failed: You may experience
> throttling for some formats
> n = KObR-BA0Tg79hZmh ; player =
> https://www.youtube.com/s/player/9c6dfc4a/player_ias.vflset/en_US/base.js
> [info] gYRDjLb41R8: Downloading 1 format(s): 137+251
> ERROR: unable to download video data: HTTP Error 403: Forbidden
>
>
> Notice that on my Windows 10 (which I don't want to use for these tasks) after a
> lengthy installation process outlined in the link in my starting post I could in
> fact download the instruction video to Windows.
>
> And I can copy it over to the video store on my Linux server.
> But this is not useful because I have scripts using yt-dlp for getting videos in
> general on my Ubuntu server so I need it to work there....
>
> Does it matter that my Windows 10 is a desktop machine whereas my Ubuntu Server
> is just that, a server with no GUI in use ever, just command line via ssh?
No, I doubt it.
>
>> or use the PPA listed so that you can install via APT:
>>
>> https://github.com/yt-dlp/yt-dlp/wiki/Installation#apt
>>
> How can I "use the PPA"?
Did you click the link?
>
>
>> or via Snap package:
>>
>> https://github.com/yt-dlp/yt-dlp/wiki/Installation#snap.
>
> Concerning snap I had a big problem when installing Ubuntu Server insamuch I
> could not get mosquitto installed via apt so it would run...
> It turnde out tha unbeknown by me the installer had put a snap version on my
> machine and that was holding the MQTT port.
> But apt happily installed mosquitto anyway.
>
> So I am not comfortable with the snap system, how can one know what is there and
> in "normal" places?
Well, I could be wrong Bo, but as I said in my earlier reply to you on
this topic, I'm almost positive that you had selected to install the
mosquitto snap when the installation got to the "Featured Snaps"
portion. It might have been inadvertent, but it seems too much of
coincidence that the one snap app that got mysteriously installed just
happened to provide the same program that you had already planned on
installing for your server from apt. What are the chances? :)
Plus, since you were intent on troubleshooting what was wrong with the
apt provided version, did you ever check out to see if the snap version
worked ok? I don't remember if you did or not, but you already have it
working so I wouldn't expect you to go back and undo everything. I
wouldn't dismiss using snaps just because of a minor mishap, though.
--
Keith
More information about the ubuntu-users
mailing list