#!/bin/bash # Recover the url. URL=`xclip -o` # Determine if it's a youtube video. Returns a result different from 0 if that's the case. SITE=`expr match "$URL" "http://www.youtube*"` if [ $SITE != 0 ]; then # Replace with player of your choice mplayer -cache 8192 `youtube-dl -g "$URL"` else get_flash_videos -y -p "$URL" fi