Fix für .flv und .mkv

This commit is contained in:
Akamaru 2015-11-22 14:40:34 +01:00
parent 47ce5b8b38
commit 8ce6e87684

View File

@ -9,12 +9,12 @@ function run(msg, matches)
end end
if string.match(msg.text, "/mp4") then if string.match(msg.text, "/mp4") then
text = run_bash('youtube-dl -o "tmp/%(title)s.%(ext)s" -i '..URL) text = run_bash('youtube-dl -o "tmp/%(title)s.%(ext)s" '..URL)
video = string.match(text, 'Merging formats into "tmp/(.*).mp4"') video = string.match(text, 'Merging formats into "tmp/(.*)"')
if not video then if not video then
file = string.match(text, '%[download%] (.*) has already been downloaded') file = string.match(text, '%[download%] (.*) has already been downloaded')
else else
file = 'tmp/'..video..'.mp4' file = 'tmp/'..video
end end
send_video(get_receiver(msg), file, ok_cb, false) send_video(get_receiver(msg), file, ok_cb, false)
end end
@ -31,6 +31,8 @@ function run(msg, matches)
message = string.gsub(message, "tmp/", "") message = string.gsub(message, "tmp/", "")
message = string.gsub(message, ".mp3", "") message = string.gsub(message, ".mp3", "")
message = string.gsub(message, ".mp4", "") message = string.gsub(message, ".mp4", "")
message = string.gsub(message, ".mkv", "")
message = string.gsub(message, ".flv", "")
return message return message
end end