From a0702322db67c150e14c15ba9afdda32b863d9ff Mon Sep 17 00:00:00 2001 From: rafa_99 Date: Fri, 22 Oct 2021 16:23:34 +0100 Subject: Updated yt script --- scripts/.local/bin/yt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/.local/bin/yt b/scripts/.local/bin/yt index 8a352f1..c897d81 100755 --- a/scripts/.local/bin/yt +++ b/scripts/.local/bin/yt @@ -1,7 +1,9 @@ #!/bin/sh -VIDEO="https://www.youtube.com/watch?v=$(echo "<-" | dmenu -p "Youtube:" | xargs -I {} queryt -s "{}" | sed "s:\t: :g" | dmenu -l 10 -p "Video: " | awk '{print $1}')" - -if [ "$VIDEO" != "" ]; then - mpv --no-config --script-opts=ytdl_hook-ytdl_path=yt-dlp --msg-level=all=no,ytdl_hook=trace "$VIDEO" +QUERY=$(: | dmenu -p "Search:") +if [ "$QUERY" != "" ]; then + VIDEO=$(queryt -s "$QUERY" -f "i t" | dmenu -l 10 -p "Video:" | awk '{print $1}') + if [ "$VIDEO" != "" ]; then + mpv --no-config --script-opts=ytdl_hook-ytdl_path=yt-dlp --msg-level=all=no,ytdl_hook=trace "https://www.youtube.com/watch?v=$VIDEO" + fi fi -- cgit v1.2.3