git.iko.soy/typeable/nixpkgs
on master help sign in
yt-dlp: add option to install a youtube-dl alias

youtube-dl development seems to have stalled and yt-dlp is the de-facto upstream nowadays. This provides an easy way to use yt-dlp as a drop-in replacement: youtube-dl = yt-dlp.override { withAlias = true; };

commitbac5fde048203c8cd5f1f5445f38757383223f4d authorAtemu <atemu.main@gmail.com> dateMon 20 Sep 2021, 10:50 (5 years ago) parentbc9b956
1 file changed+5
pkgs/tools/misc/yt-dlp/default.nix+5
pkgs/tools/misc/yt-dlp/default.nix+5
@@ -12,6 +12,7 @@
1212, rtmpSupport ? true
1313, phantomjsSupport ? false
1414, hlsEncryptedSupport ? true
15+, withAlias ? false # Provides bin/youtube-dl for backcompat
1516}:
1617
1718buildPythonPackage rec {
@@ -50,6 +51,10 @@ buildPythonPackage rec {
5051 # Requires network
5152 doCheck = false;
5253
54+ postInstall = lib.optionalString withAlias ''
55+ ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl"
56+ '';
57+
5358 meta = with lib; {
5459 homepage = "https://github.com/yt-dlp/yt-dlp/";
5560 description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";