1
1
Fork 0

added destination path to youtube_converter

This commit is contained in:
David Starzengruber 2011-01-03 12:02:55 +01:00
parent c9fdc61dc0
commit 424e44a5f9
1 changed files with 11 additions and 5 deletions

View File

@ -23,7 +23,7 @@ if [[ $1 == "-h" || $1 == "--help" ]]; then
# #
# # # # # # # # # # # # # # # # # # # # #"
echo
echo "usage: ./youtube_converter <mp3/mpeg> <youtube-link>"
echo "usage: youtube_converter <mp3/mpeg> <youtube-link>"
echo
exit 0
fi
@ -65,6 +65,13 @@ else
done
fi
# set output destination
if [ -z $3 ];then
destinationpath=$(pwd)
else
destinationpath=$3
fi
# getting flash filename
file=$(ls -l /tmp | grep Flash | awk '{print $8}')
secondfile=$(echo $file | awk '{print $2}')
@ -114,17 +121,16 @@ echo "starting convertion of $title @ $link"
if [ $mediatype != "mpeg" ]; then
ffmpeg -i /tmp/$file -vn temp.wav
lame --preset 128 temp.wav "$title.mp3"
lame --preset 128 temp.wav "$destinationpath/$title.mp3"
rm temp.wav
title="$title.mp3"
else
ffmpeg -i /tmp/$file -sameq -acodec libmp3lame -ab 192k "$title.mpeg"
ffmpeg -i /tmp/$file -sameq -acodec libmp3lame -ab 192k "$destinationpath/$title.mpeg"
title="$title.mpeg"
fi
wd=$(pwd)
echo
echo "Output file $wd/$title"
echo "Output file $destinationpath/$title"
echo
exit 0