diff --git a/tools/TUBE.copy.sh b/tools/TUBE.copy.sh index 4207ac3bd..4078f8bee 100755 --- a/tools/TUBE.copy.sh +++ b/tools/TUBE.copy.sh @@ -34,17 +34,20 @@ for yurl in $(cat ~/.zen/tmp/tiddlers.json | jq -r '.[].text' | grep 'http'); do mkdir -p ~/.zen/tmp/tube + + TITLE=$(yt-dlp --print title ${yurl}) + TITLE=$(echo "$TITLE" | tr -cd '[:alnum:]._-') + # https://github.com/yt-dlp/yt-dlp#format-selection-examples # SUBS ? --write-subs --write-auto-subs --sub-langs "en, en-orig" --embed-subs # TODO : DELAY COPY OPERATION... Astro can download quicker at 03:00 AM echo "yt-dlp -f \"bv*[ext=mp4][height<=480]+ba/b[height<=480] / bv*[ext=mp4][height<=720]+ba/b[height<=720]\" --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] / bv*[ext=mp4][height<=720]+ba/b[height<=720]" -S "filesize:500M" --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] / bv*[ext=mp4][height<=720]+ba/b[height<=720]" -S "filesize:500M" --no-mtime --embed-thumbnail --add-metadata -o "$HOME/.zen/tmp/tube/$TITLE.%(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="$TITLE.mp4" echo "$ZFILE"