summaryrefslogtreecommitdiff
path: root/util/wv
diff options
context:
space:
mode:
Diffstat (limited to 'util/wv')
-rwxr-xr-xutil/wv20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/wv b/util/wv
new file mode 100755
index 0000000..d5a8a13
--- /dev/null
+++ b/util/wv
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Watch video: it downloads it into $WV_DIRECTORY, then plays it. If no
+# argument passed, it will select a video in $WV_DIRECTORY.
+
+if [ -z "$WV_DIRECTORY" ] ; then
+ echo "WV_DIRECTORY not set"
+ exit 1
+fi
+
+mkdir -p "$WV_DIRECTORY"
+
+if [ -z "$1" ] ; then
+ # No args.
+ echo "No args: TODO: implement selecting video in WV_DIRECTORY"
+ exit 1
+fi
+
+yt-dlp "$1" -P "$WV_DIRECTORY" -o "%(title)s.%(ext)s" -f "bv*[height<=720]+ba/b[height<=720] / wv*+ba/w"
+fn="$(yt-dlp "$1" -P "$WV_DIRECTORY" -o "%(title)s.%(ext)s" --print filename)"
+mpv "$fn"