ytopener - plumber - Plumber – a modern approach to plumbing
 (HTM) git clone git://r-36.net/plumber
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       ytopener (355B)
       ---
            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                 $PLUMB_MEDIA "$uri"
           23         fi
           24 fi
           25