From c98eecab74dba69ef56367f2335ae8a660170981 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 15 Sep 2022 14:23:29 +0200 Subject: [PATCH] 1423 --- tools/TUBE.copy.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/TUBE.copy.sh b/tools/TUBE.copy.sh index 3c7788b38..930506308 100755 --- a/tools/TUBE.copy.sh +++ b/tools/TUBE.copy.sh @@ -40,12 +40,15 @@ for yurl in $(cat ~/.zen/tmp/tiddlers.json | jq -r '.[].text' | grep 'http'); do echo "yt-dlp -f \"bv*[ext=mp4][height<=480]+ba/b[height<=480] / wv*+ba/w\" --no-mtime --embed-thumbnail --add-metadata -o \"$HOME/.zen/tmp/tube/%(title)s.%(ext)s\" ${yurl}" yt-dlp -f "bv*[ext=mp4][height<=480]+ba/b[height<=480] / wv*+ba/w" --no-mtime --embed-thumbnail --add-metadata -o "$HOME/.zen/tmp/tube/%(title)s.%(ext)s" ${yurl} - + echo # Get last writen file... TODO: Could we do better ? # ZFILE=$(ls -t ~/.zen/tmp/tube/*.mp4 | head -n 1) TITLE=$(yt-dlp --print title ${yurl}) + echo $TITLE ZFILE=$(ls "$HOME/.zen/tmp/tube/$TITLE"* | head -n 1) - [[ ! -f ~/.zen/tmp/tube/$ZFILE ]] && echo "No FILE -- EXIT --" && exit 1 + echo $ZFILE + [[ ! -f "$HOME/.zen/tmp/tube/$ZFILE" ]] && echo "No FILE -- EXIT --" && exit 1 + echo echo "~/.zen/tmp/tube/$ZFILE downloaded"