diff options
author | rafa_99 <raroma09@gmail.com> | 2021-10-22 16:23:34 +0100 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2021-10-22 16:23:34 +0100 |
commit | a0702322db67c150e14c15ba9afdda32b863d9ff (patch) | |
tree | 605166380422be1cda574508b7068a08be178435 /scripts | |
parent | 1724b3dcd87c7ecd8b64a603253a5f909b9edf07 (diff) |
Updated yt script
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/.local/bin/yt | 10 |
1 files changed, 6 insertions, 4 deletions
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 |