Simple shell program for finding and watching remote videos over SFTP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
528 B

#!/bin/sh
usage="$0 [-u <user> -h <host> -p <path> -m <menu> -v <videoplayer>]"
host=localhost
path="~"
menu='dmenu-wl'
video='mpv'
while getopts ':u:h:m:p:v' opt
do
case $opt in
u) USER=$OPTARG;;
h) host=$OPTARG;;
p) path=$OPTARG;;
m) menu=$OPTARG;;
v) video=$OPTARG;;
?) echo "error: invalid option: $usage"
exit 1;;
esac
done
find="cd $path; find ~+ -type f -name \"*.mp4\""
user=$USER
ssh $user@$host $find | $menu | xargs -I% $video "sftp://$user@$host%"