[Howto] Install latest youtube-dl on LM20

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
cpedretti
Level 2
Level 2
Posts: 78
Joined: Tue Mar 10, 2020 12:06 am

[Howto] Install latest youtube-dl on LM20

Post by cpedretti »

youtube-dl are a program in command line to download video from youtube and many other sites.

Source


youtube-dl needs the python-pip package for upgrading it, but since January 1st 2020 Python 2.7 reaches end of life after 20 years of development.
(Source)

This is the error message after classic installation, because no python 2.7 are availlable in Ulyana sources:

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


To solve this issue we need two things, python3-pip package and change the path to work fine.


At first download the python3-pip package like:

Code: Select all

sudo apt install python3-pip -y

We can install latest youtube-dl or take it in the Mint sources with Synaptic.


To upgrade it:

Code: Select all

sudo pip3 install --upgrade youtube_dl

Now we change the path doing a symbolic link:

Code: Select all

sudo ln -s /usr/bin/python3 /usr/local/bin/python

Yet we can download vids, just open an terminal and paste:

Code: Select all

youtube-dl my_video_link

Source
AMD Ryzen 2600 - 16GB DDR4 - Sapphyre RX570 8GB - SSD MLC HyperX/HDD Toshiba - Mobo Gygabyte AB350 Gaming - PSU Lepa MaxBron 500W - Case Zalman X3 White

LMDE4 Kernel 4.19
Shadow in Fire
Level 2
Level 2
Posts: 56
Joined: Fri Jul 20, 2018 1:18 am

Re: [Howto] Install latest youtube-dl on LM20

Post by Shadow in Fire »

Here's another method you could also try:

Code: Select all

$ wget -O - https://yt-dl.org/downloads/latest/youtube-dl | sudo tee /usr/local/bin/youtube-dl >/dev/null
$ sudo chmod a+x /usr/local/bin/youtube-dl
Check the current version and upgrade (if outdated):

Code: Select all

$ youtube-dl --version
$ sudo youtube-dl -U
I do this myself to bypass obtaining potentially outdated software from the official repositories, regardless of distro.
User avatar
cpedretti
Level 2
Level 2
Posts: 78
Joined: Tue Mar 10, 2020 12:06 am

Re: [Howto] Install latest youtube-dl on LM20

Post by cpedretti »

Shadow in Fire wrote:
Thu Jul 09, 2020 9:11 am
Here's another method you could also try:

Code: Select all

$ wget -O - https://yt-dl.org/downloads/latest/youtube-dl | sudo tee /usr/local/bin/youtube-dl >/dev/null
$ sudo chmod a+x /usr/local/bin/youtube-dl
Check the current version and upgrade (if outdated):

Code: Select all

$ youtube-dl --version
$ sudo youtube-dl -U
I do this myself to bypass obtaining potentially outdated software from the official repositories, regardless of distro.
This method is without pip, nice to know it, because installed from the Ubuntu repo or from the project source you can't use sudo youtube-dl -U to upgrade it. :)

In my Howto I kept the logic of the project, so as not to lose too many users along the way :P
AMD Ryzen 2600 - 16GB DDR4 - Sapphyre RX570 8GB - SSD MLC HyperX/HDD Toshiba - Mobo Gygabyte AB350 Gaming - PSU Lepa MaxBron 500W - Case Zalman X3 White

LMDE4 Kernel 4.19
Shadow in Fire
Level 2
Level 2
Posts: 56
Joined: Fri Jul 20, 2018 1:18 am

Re: [Howto] Install latest youtube-dl on LM20

Post by Shadow in Fire »

In this case, updating to the latest build is extremely important, because Google continues to mess up the code and make it very difficult to download or stream (using Mpv or similar). :P

Also, this is very handy for clearing up 403 errors:

Code: Select all

$ youtube-dl --rm-cache
Post Reply

Return to “Tutorials”