diff --git a/youtube/youtube2mp3.sh b/youtube/youtube2mp3.sh index 6c832cd..f0653f0 100755 --- a/youtube/youtube2mp3.sh +++ b/youtube/youtube2mp3.sh @@ -7,7 +7,7 @@ if [[ $address =~ $regex ]]; then video_id=${BASH_REMATCH[1]} video_id=$(echo $video_id | cut -d'&' -f1) video_title="$(youtube-dl --get-title $address)" - youtube-dl $address + youtube-dl --output "%(id)s.%(ext)s" $address ext=$(ls $video_id.* |cut -f2 -d'.') ffmpeg -i $video_id.$ext "$video_title".wav lame "$video_title".wav "$video_title".mp3