diff --git a/konata.sh b/konata.sh index edf3ab5..8c259d8 100755 --- a/konata.sh +++ b/konata.sh @@ -71,9 +71,15 @@ mp3(){ tmp="/tmp/mp3" [ -d $tmp ] && mkdir $tmp sendmsg "Downloading, this might take a while..." - youtube-dl --add-metadata --metadata-from-title "%(artist)s - %(title)s" -x --audio-format mp3 -o "$tmp/%(title)s.%(ext)s" "$args" - sendfile "$tmp/$(ls $tmp)" - rm $tmp/* + youtube-dl -f 140 --max-filesize 50M -o "$tmp/%(title)s.%(ext)s" "$args" + rm $tmp/*.part + if [ -f $tmp/* ] + then + sendfile "$tmp/$(ls $tmp)" + rm $tmp/* + else + sendmsg "I couldn't download this file. Perhaps it's too large?" + fi } stat(){