Perusal, Synthesis, Bliss

September 8, 2023: switch from youtube-dl to yt-dlp on OpenSUSE 15.3

youtube-dl is not able to download some recent videos on Youtube, so I have installed the yt-dlp package provided by OpenSUSE 15.3, and then updated it to its latest version,
$ sudo yt-dlp -U
[sudo] password for root: 
Available version: stable@2023.07.06, Current version: stable@2023.03.04
Current Build Hash: 2ad255b43ec71196e5e36c2222cac9b62491634a492ae464454da3abc7dfaf00
Updating to stable@2023.07.06 ...
Updated yt-dlp to stable@2023.07.06
Without this update, it is also impossible to download Youtube downloads. Then it is needed to change the shebang at the start of yt-dlp:
$ head -n1 /usr/bin/yt-dlp
#!/usr/bin/env python3.9
instead of the default
#!/usr/bin/env python3
This allows to start the executable with Python 3.9, as written in the manual page of "env" ("Set […] the environment and run COMMAND."). Otherwise the following error is obtained:
$ yt-dlp
[…]
Exception: You are using an unsupported version of Python. Only Python versions 3.7 and above are supported by yt-dlp
Indeed fortunately my openSUSE 15.3 version provides a Python version greater than 3.6 (which is the standard version being installed in 15.3):
$ zypper se --provides /usr/bin/python3.9
[…]
i | python39-base | Python 3 Interpreter and Stdlib Core | package