Improve youtube-dl

Read: work around its retardation
This commit is contained in:
Michael De Roover 2021-01-02 17:42:10 +01:00
parent 6e3946229e
commit d5db8cfb7a
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -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(){