From 62f92d6ed11b8892d32b59178b07e1d52c154bc6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 8 Oct 2023 13:12:11 +0200 Subject: refactor --- bin/extra/ehbtodl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/extra/ehbtodl b/bin/extra/ehbtodl index df11797..fc873f6 100755 --- a/bin/extra/ehbtodl +++ b/bin/extra/ehbtodl @@ -1,9 +1,13 @@ #!/usr/bin/env sh -echo "$1" | sed 's/-H/\\\n\t&/g' | sed '/gzip/d' > /tmp/curlcommand.sh -sh /tmp/curlcommand.sh > /tmp/ehbso.html -vids="$(grep -oE "youtube\.com/embed/.{11}" /tmp/ehbso.html | cut -d'/' -f 3 | tr '\n' ' ')" +printf "%s\n" "$1" | + sed 's/-H/\\\n&/g' | + sed '/gzip/d' | + tee /tmp/curlcommand.sh | + sh > /tmp/ehbso.html +vids="$(grep -oE "youtube\.com/embed/.{11}" /tmp/ehbso.html | + cut -d'/' -f 3 | + tr '\n' ' ')" for i in $vids -do - echo "https://www.youtube.com/watch?v=$i" +do printf "%s\n" "https://www.youtube.com/watch?v=$i" done > /tmp/todownload # yt-dlp -P "$HOME/Downloads/vids" -o "%(title)s" -a /tmp/todownload -- cgit v1.2.3