summaryrefslogtreecommitdiffstats
path: root/ytplay
diff options
context:
space:
mode:
Diffstat (limited to 'ytplay')
-rwxr-xr-xytplay4
1 files changed, 4 insertions, 0 deletions
diff --git a/ytplay b/ytplay
new file mode 100755
index 0000000..e505a3b
--- /dev/null
+++ b/ytplay
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+query=$(printf '%s' "$*" | tr ' ' '+' )
+mpv "https://youtube.com/$(curl -s "https://vid.puffyan.us/search?q=$query" | grep -Eo "watch\?v=.{11}" | head -n 1)"