Download youtube videos as mp3
Posted by Kelvin on 04 Dec 2010 at 12:08 pm | Tagged as: Ubuntu
For Ubuntu..
sudo apt-get install ffmpeg cd ~/bin wget https://github.com/rg3/youtube-dl/raw/2010.11.19/youtube-dl chmod +x youtube-dl wget http://www.supermind.org/scripts/youtube2mp3 chmod +x youtube2mp3
The contents of youtube2mp3 is simple:
#!/bin/bash #!/bin/bash x=/tmp/.youtube-dl-$RANDOM-$RANDOM.flv youtube-dl --output=$x --format=18 "$1" ffmpeg -i $x -vn -ar 44100 -ac 2 -ab 256k -f mp3 "$2"
Now get the youtube URL you want to convert to MP3, and run it like so:
youtube2mp3 <youtube_url>
For example:
youtube2mp3 http://www.youtube.com/watch?v=cFhaBEtmHeU
- Introducing Bash-whacking
- Recursively delete .svn folders
- Move up multiple directories in bash
- Download youtube videos as mp3
- Useful ffmpeg commands
- Recursively copy only files with certain extension with rsync
- Recursive directory listing sorted by file size
- Download google video and youtube from command-line
- Reset wireless in Ubuntu 10.04 Lucid
- Delete files older than x days
- MD5 a directory recursively
- Convert fixed-width file to CSV
- Recursively find the n latest modified files in a directory
- Using sed to delete lines from a file
- Determine if a server supports Gzip compression
- Delete directories older than x days
- Mount a .dmg file in Ubuntu
- Batch convert svg to png in Ubuntu
- Split wav/flac/ape files with cue