plumber

Plumber – a modern approach to plumbing
git clone git://r-36.net/plumber
Log | Files | Refs | LICENSE

ytopener (417B)


      1 #!/bin/sh
      2 
      3 uri="$@"
      4 case "$uri" in
      5 youtube://*|yt://*)
      6 	id="$(printf "%s\n" "$uri" | cut -d '/' -f 3-)"
      7 	uri="https://www.youtube.com/watch?v=${id}"
      8 	;;
      9 *)
     10 	;;
     11 esac
     12 
     13 if slmcc isdown;
     14 then
     15 	slmcc play "$uri"
     16 else
     17 	if [ -z "$CACA_DRIVER" -a -z "$DISPLAY" ];
     18 	then
     19 		export CACA_DRIVER="ncurses"
     20 		mplayer -vo caca "$uri"
     21 	else
     22 		if [ -n "$MEDIAPLAYER" ];
     23 		then
     24 			$MEDIAPLAYER "$uri"
     25 		else
     26 			mpv "$uri"
     27 		fi
     28 	fi
     29 fi
     30