summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2021-10-22 16:23:34 +0100
committerrafa_99 <raroma09@gmail.com>2021-10-22 16:23:34 +0100
commita0702322db67c150e14c15ba9afdda32b863d9ff (patch)
tree605166380422be1cda574508b7068a08be178435 /scripts
parent1724b3dcd87c7ecd8b64a603253a5f909b9edf07 (diff)
Updated yt script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/.local/bin/yt10
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