summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2021-09-11 23:15:42 +0100
committerrafa_99 <raroma09@gmail.com>2021-09-11 23:15:42 +0100
commit19b6b1a94e68411c7523cd55747415ca1add1173 (patch)
treef7e4b089232c7eee2272e30b28dd76ea946608d6
parent14f71b31679917f1b95d978c7546e850288a1200 (diff)
Fixed Up YT Script
-rwxr-xr-xscripts/.local/bin/yt6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/.local/bin/yt b/scripts/.local/bin/yt
index 62e2a62..42e4732 100755
--- a/scripts/.local/bin/yt
+++ b/scripts/.local/bin/yt
@@ -1,3 +1,7 @@
#!/bin/sh
-echo "<-" | dmenu -p "Youtube:" | xargs -I {} queryt -s "{}" | sed "s:\t: :g" | dmenu -l 10 -p "Video: " | awk '{print $1}' | xargs -I {} mpv --ytdl-format=22 "https://youtube.com/watch?v={}"
+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 --ytdl-format=22 "$VIDEO"
+fi