$ sudo apt-get install youtube-dl
Create a file youtube-conv.sh with the following code
#/bin/sh
name=$(youtube-dl --get-title ${1}|sed 's/ /_/g')
echo title ${name}
id=$(echo ${1} | sed 's/=/ /g' | awk '{print $2}')
echo download to ${id}
youtube-dl ${1} -o ${id}
# > /dev/null
echo convert to ~/youtube-dl/${name}.mp3
convert=$(ffmpeg -i ${id} -f mp3 ~/youtube-dl/${name}.mp3)
echo ${name}.mp3 created
echo remove ${id}
rm ${id}
Invoke the script with the youtube url as argument, e.g.
./youtube-conv.sh http://www.youtube.com/watch?v=7cF2ZSNrEIw
Note: there are issues, if the video name contains non ASCII characters
Keine Kommentare:
Kommentar veröffentlichen