yt-dlp install the latest version on freebsd

Freebsd install the latest version of yt-dlp even if you are running quarterly packages.
Quarterly packages are released every 3 months which means the version of yt-dlp will be quite old


freebsd yt-dlp latest release install

we will manually download the latest release of yt-dlp

however the the yt-dlp shebang points to python3 so we need to fix issue using a symlink
and alter our shell path so binaries in our home bin directory override those installed in /usr/local/bin

this will allow applications that use yt-dlp in the backend to use the lastest version
instead of the old version installed with pkg

the yt-dlp shebang points to python3
so we need to create a symlink from python 3.9 to python3

obviously you need python3.9 installed

Code:
sudo ln -s /usr/local/bin/python3.9 /usr/local/bin/python3

edit your ~/.zshenv

Code:
vi ~/.zshenv

set your path so that the bin directory in your home comes before /usr/local/bin

Code:
typeset -U PATH path
path=("$HOME/bin" "/usr/local/bin" "$path[@]")
export PATH

this allows us override yt-dlp installed in /usr/local/bin with our newer version install in the bin directory in your home
download yt-dlp from the release on github


make yt-dlp executable

Code:
chmod +x yt-dlp

and move it to the bin directory in your home
if you dont have a bin directory create it

Code:
mv yt-dlp ~/bin

run which yt-dlp

Code:
which yt-dlp

it should output

Code:
/home/username/bin/yt-dlp

instead of

Code:
/usr/local/bin/yt-dlp

check the version

Code:
yt-dlp --version

ouput

2023.11.16

pkg version

Code:
/usr/local/bin/yt-dlp --version

outputs

2023.07.06

update yt-dlp in your bin directory by running

Code:
yt-dlp -U
 
yt-dlp package version

Code:
/usr/local/bin/yt-dlp --version

2024.03.10

yt-dlp manually installed version

Code:
yt-dlp --version

2024.05.27

answer = yes
 
Thanks!

In my opinion www/yt-dlp should be one of the few exceptional ports getting version upgrades in the quarterly branch. Changes on youtube etc. happen quite often and can render yt-dlp in quarterly completely useless until the next branch. But of course that's for the port maintainer to decide.

Well, Merge from Main is allowed among other reasons as for example bug fixes so this should be not a problem.
 
Back
Top