From af706fce731e5667e91d313cbd95c3bdb5e9f906 Mon Sep 17 00:00:00 2001 From: Atemu Date: Mon, 20 Sep 2021 10:50:53 +0200 Subject: [PATCH] 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; }; --- pkgs/tools/misc/yt-dlp/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/yt-dlp/default.nix b/pkgs/tools/misc/yt-dlp/default.nix index e2c90ef0530..40af80a4606 100644 --- a/pkgs/tools/misc/yt-dlp/default.nix +++ b/pkgs/tools/misc/yt-dlp/default.nix @@ -12,6 +12,7 @@ , rtmpSupport ? true , phantomjsSupport ? false , hlsEncryptedSupport ? true +, withAlias ? false # Provides bin/youtube-dl for backcompat }: buildPythonPackage rec { @@ -50,6 +51,10 @@ buildPythonPackage rec { # Requires network doCheck = false; + postInstall = lib.optionalString withAlias '' + ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl" + ''; + meta = with lib; { homepage = "https://github.com/yt-dlp/yt-dlp/"; description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";