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