MPlayer youtube script: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
bash script for playing youtube videos | bash script for playing youtube videos | ||
#save it as youtube.sh | |||
#chmod +x youtube.sh | |||
#place it somewhere in PATH (like /usr/local/bin ) | |||
*youtube.sh | Usage: | ||
*youtube.sh <url> [mplayer args] | |||
*youtube.sh http://www.youtube.com/watch?v=example -dumpstream -dumpfile something.flv | *youtube.sh http://www.youtube.com/watch?v=example -dumpstream -dumpfile something.flv | ||
*youtube.sh http://www.youtube.com/watch?v=example -aspect 16:9 | *youtube.sh http://www.youtube.com/watch?v=example -aspect 16:9 |
Revision as of 07:43, 9 August 2008
bash script for playing youtube videos
- save it as youtube.sh
- chmod +x youtube.sh
- place it somewhere in PATH (like /usr/local/bin )
Usage:
- youtube.sh <url> [mplayer args]
- youtube.sh http://www.youtube.com/watch?v=example -dumpstream -dumpfile something.flv
- youtube.sh http://www.youtube.com/watch?v=example -aspect 16:9
- youtube.sh http://www.youtube.com/watch?v=example -xy 2
#!/bin/bash if [ -z "$1" ]; then echo "No URL!"; exit; fi url=$1 shift echo \"http://www.youtube.com/get_video?video_id=`wget -q -O - $url | grep fullscreenUrl | awk -F'video_id=' '{ print $2 }' | sed -e 's/ /_/g' | tr -d \'\; `\" | xargs mplayer $*
created by enouf and n3kl and amphi