From 71c4bf5f878967ad99f34f1559ddc8426e2394a2 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Tue, 21 Jun 2022 23:18:04 -0400 Subject: [PATCH] Replace youtube-dl packages with a manual recipe --- deps/youtube-dl/Makefile | 3 +++ home/lib/login_functions.sh | 7 ++++--- pkgs-pip.list | 1 - pkgs-void.list | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 deps/youtube-dl/Makefile diff --git a/deps/youtube-dl/Makefile b/deps/youtube-dl/Makefile new file mode 100644 index 0000000..fe4c509 --- /dev/null +++ b/deps/youtube-dl/Makefile @@ -0,0 +1,3 @@ +all: + curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl + chmod a+rx /usr/local/bin/youtube diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 6133181..3a21209 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -342,14 +342,15 @@ _yt() { local -r uri="$2" local -r opts="$3" - local -r id=$(youtube-dlc --get-id "$uri") - local -r title=$(youtube-dlc --get-title "$uri" | sed 's/[^А-Яа-яA-Za-z0-9._-]/_/g') + local -r yt=youtube-dl + local -r id=$("$yt" --get-id "$uri") + local -r title=$("$yt" --get-title "$uri" | sed 's/[^А-Яа-яA-Za-z0-9._-]/_/g') local -r dir="${base_dir}/${title}--${id}" mkdir -p "$dir" cd "$dir" || kill -INT $$ echo "$uri" > 'uri' - youtube-dlc $opts -c --write-all-thumbnails --write-description --write-info-json "$uri" + "$yt" $opts -c --write-all-thumbnails --write-description --write-info-json "$uri" } yt_audio() { diff --git a/pkgs-pip.list b/pkgs-pip.list index dc6332a..03e3f0b 100644 --- a/pkgs-pip.list +++ b/pkgs-pip.list @@ -1,5 +1,4 @@ # twtxt -youtube-dlc terminal-colors liquidctl diff --git a/pkgs-void.list b/pkgs-void.list index 7718b69..964f2c7 100644 --- a/pkgs-void.list +++ b/pkgs-void.list @@ -366,7 +366,6 @@ xsv # CLI CSV tool xtools xwininfo # Needed for picom-trans to work, but isn't a dep of picom. yajl-dbg -youtube-dl zathura zathura-djvu zathura-pdf-mupdf -- 2.20.1