From f2473f0ed875fb059affbbedd6c464aecba471e1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 6 Apr 2018 14:38:35 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odin/strm.nix | 4 +++- odin/strm/download_youtube | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/odin/strm.nix b/odin/strm.nix index 82ba2bdb..8c88514e 100644 --- a/odin/strm.nix +++ b/odin/strm.nix @@ -6,7 +6,9 @@ stdenv.mkDerivation { phases = [ "unpackPhase" "buildPhase" "installPhase" ]; - inherit zsh ffmpeg-full youtube-dl pv notmuch; + inherit zsh pv notmuch; + ffmpeg = ffmpeg-full; + youtubedl = youtube-dl; buildPhase = '' substituteAllInPlace download_youtube diff --git a/odin/strm/download_youtube b/odin/strm/download_youtube index 41d532cc..4c37cb7e 100755 --- a/odin/strm/download_youtube +++ b/odin/strm/download_youtube @@ -2,7 +2,7 @@ alwaysTranscode=false -ffmpeg() { { { @ffmpeg-full@/bin/ffmpeg $@ 1>&3 } 2>&1 | stdbuf -o 0 tr '\r' '\n' | grep -v --line-buffered -E '^$' 1>&2 } 3>&1 } +ffmpeg() { { { @ffmpeg@/bin/ffmpeg $@ 1>&3 } 2>&1 | stdbuf -o 0 tr '\r' '\n' | grep -v --line-buffered -E '^$' 1>&2 } 3>&1 } pv() { { { @pv@/bin/pv -D 2 -i 2 -w 100 -H 1 -f $@ 1>&3 } 2>&1 | stdbuf -o 0 tr '\r' '\n' | grep -v --line-buffered -E '^$' 1>&2 } 3>&1 } trimName() { prefix=$1; shift; printf "%s%s" ${prefix} $(awk -v len=$((19 - $#prefix)) '{ if (length($0) > len) print substr($0, 1, len-3) "..."; else print; }' <<<"${(j: :)@}")} @@ -116,7 +116,7 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}" typeset -a args args=(--no-playlist --add-metadata --newline --mark-watched -f ${formatString}) - @youtube-dl@/bin/youtube-dl ${args} --get-filename -o $'%(extractor)s\n%(id)s\n%(format)s\n%(title)s\n%(ext)s' -- ${url} | { + @youtubedl@/bin/youtube-dl ${args} --get-filename -o $'%(extractor)s\n%(id)s\n%(format)s\n%(title)s\n%(ext)s' -- ${url} | { oldIFS=${IFS} export IFS= @@ -156,7 +156,7 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}" fi fi - @youtube-dl@/bin/youtube-dl $args -o "${filename:r}.%(ext)s" -- ${url} 2>&1 &1