Created
January 25, 2011 18:53
-
-
Save lemming/795404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function youtube-play() { | |
if [ $# -eq 1 ]; then | |
YOUTUBE_LINK=$1 | |
else | |
YOUTUBE_LINK=`xclip -o -selection "clipboard" | grep -oE 'http[^&]*' | head -n1` | |
fi | |
YOUTUBE_COOKIES=$HOME/.youtube.cookies | |
if [ ! -e $YOUTUBE_COOKIES ]; then | |
curl -c $YOUTUBE_COOKIES http://www.youtube.com > /dev/null 2>&1 | |
fi | |
mplayer -cache 8192 -cookies -cookies-file $YOUTUBE_COOKIES `youtube-dl -g --cookies $YOUTUBE_COOKIES --max-quality=22 $YOUTUBE_LINK` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment