Permalink
Browse files

[add] bitrate list

  • Loading branch information...
1 parent d842593 commit 9ef8e1b5487fbafe71273f24872c0e88e3bf6734 @ptkdev ptkdev committed Mar 18, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 youtube2mp3.sh
View
@@ -1,6 +1,7 @@
#!/bin/bash
address=$(zenity --width=600 --height=150 --entry --title="YouTube MP3 Extractor" --text "Enter Youtube address (then click OK and then select the destination directory for your MP3 file):")
+bitrate=$(zenity --list --text "YouTube MP3 Bitrate" --radiolist --column "Pick" --column "Bitrate" TRUE 128 FALSE 192 FALSE 256 FALSE 320)
return_code=$?
regex='v=(.*)'
dest_dir=$(zenity --file-selection --directory)
@@ -20,11 +21,11 @@ if [[ $return_code -eq 0 ]]; then
fi
ffmpeg -i $video_id.$ext /tmp/"$video_title".wav
- lame /tmp/"$video_title".wav $dest_dir/"$video_title".mp3
+ lame /tmp/"$video_title".wav $dest_dir/"$video_title".mp3 -b $bitrate
rm $video_id.$ext /tmp/"$video_title".wav
zenity --width=260 --height=130 --title "YouTube MP3 Extractor" --info --text "Your MP3 file is ready."
else
zenity --error --text "Sorry but the system encountered a problem. Please check your YouTube address and try again later..."
fi
-fi
+fi

0 comments on commit 9ef8e1b

Please sign in to comment.