From 4d0bd914e7c1ee65f4036e60149a7b891906a5d3 Mon Sep 17 00:00:00 2001 From: George Abbott Date: Tue, 31 Oct 2023 17:54:07 +0000 Subject: Commit all to date. --- util/wv | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 util/wv (limited to 'util/wv') 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" -- cgit v1.2.1