From 2b81fd44e81453e034f7eb62ebb7ced36f8e4d9e Mon Sep 17 00:00:00 2001 From: tommieharyanto Date: Tue, 2 Oct 2018 11:13:33 +0700 Subject: [PATCH] Make sure youtube-dl save download to 'ID.EXT' --- youtube/youtube2mp3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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