#!/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"