diff --git a/youtube/youtube2mp3.sh b/youtube/youtube2mp3.sh index 6c832cd..95108d2 100755 --- a/youtube/youtube2mp3.sh +++ b/youtube/youtube2mp3.sh @@ -2,7 +2,7 @@ # A very simple Bash script to download a YouTube video # and extract the music file from it. address=$1 -regex='v=(.*)' +regex='v=([A-Za-z0-9_-]{11})' if [[ $address =~ $regex ]]; then video_id=${BASH_REMATCH[1]} video_id=$(echo $video_id | cut -d'&' -f1)