From 0d43d2e26d1fc263415ee7578b9d90e7bcd9da8d Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 6 May 2022 17:53:20 +0200 Subject: download: youtube-dl -> yt-dlp --- download.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/download.nix b/download.nix index fd122b2..faffebb 100644 --- a/download.nix +++ b/download.nix @@ -1,6 +1,7 @@ let pkgs = import {}; npkgs = import (builtins.fetchTarball "https://github.com/nixos/nixpkgs/archive/master.tar.gz") {}; + youtube-dl = "${npkgs.yt-dlp}/bin/yt-dlp"; # add_link # download new music from source @@ -25,7 +26,7 @@ let utils.extract_playlist = pkgs.writers.writeDash "utils.extract_playlist" '' set -euf - ${npkgs.youtube-dl}/bin/youtube-dl \ + ${youtube-dl} \ -i -o "http://www.youtube.com/watch?v=%(id)s#%(title)s" \ --restrict-filenames --get-filename $1 ''; @@ -126,10 +127,10 @@ let if ls "$target_folder" | ${pkgs.gnugrep}/bin/grep -Fe "$id.ogg"; then echo "file already exists: $1" else - duration=$(${npkgs.youtube-dl}/bin/youtube-dl -J "$1" | ${pkgs.jq}/bin/jq .duration) + duration=$(${youtube-dl} -J "$1" | ${pkgs.jq}/bin/jq .duration) if [ "$duration" -le 1000 ] && [ "$duration" -gt 60 ]; then cd "$TMPDIR" - ${npkgs.youtube-dl}/bin/youtube-dl \ + ${youtube-dl} \ -i -o "%(title)s-%(id)s.%(ext)s" \ --restrict-filenames --add-metadata \ --audio-format vorbis \ @@ -153,6 +154,5 @@ in pkgs.stdenv.mkDerivation { (pkgs.writers.writeDashBin "dl-track" '' ${utils.download_ogg} "$@" '') - npkgs.youtube-dl ]; } -- cgit v1.2.3