From 8ce6e87684dd9987da454849cdfa65859b4a85ec Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sun, 22 Nov 2015 14:40:34 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20f=C3=BCr=20.flv=20und=20.mkv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/youtube_dl.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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