From c530267130ae7f869f8ecc3aba063b8c5e612b41 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 29 Jun 2015 21:11:47 +0200 Subject: [PATCH] --no-continue --- plugins/youtube_mp3.lua | 5 +++-- tmp/sound.mp3 | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 tmp/sound.mp3 diff --git a/plugins/youtube_mp3.lua b/plugins/youtube_mp3.lua index f200b73..0baa7ee 100644 --- a/plugins/youtube_mp3.lua +++ b/plugins/youtube_mp3.lua @@ -1,18 +1,19 @@ -- Requires: (sudo) apt-get install youtube-dl +-- See https://github.com/rg3/youtube-dl/blob/master/README.md#options function run(msg, matches) URL = matches[1] local receiver = get_receiver(msg) if string.match(msg.text, '"') then return 'Vergiss es' else - text = run_bash("rm tmp/sound.mp3 && youtube-dl -o tmp/sound.mp3 --audio-format mp3 " .. URL) + text = run_bash("youtube-dl -o tmp/sound.mp3 --audio-format mp3 --no-continue " .. URL) send_audio(get_receiver(msg), "tmp/sound.mp3", ok_cb, false) return URL .. ' wurde gedownloadet und wird jetzt gesendet! \nDas kann je nach Video sehr lang dauern! \nAlso habt Geduld!' end end return { - description = "Downloadet und sendet die mp3 von einem YouTube-Video", + description = "Downloadet und sendet die MP3 von einem YouTube-Video", usage = {"/mp3 [Link]"}, patterns = {"^/mp3 (https?://[%w-_%.%?%.:/%+=&]+)$"}, run = run diff --git a/tmp/sound.mp3 b/tmp/sound.mp3 deleted file mode 100644 index 9540913..0000000 --- a/tmp/sound.mp3 +++ /dev/null @@ -1 +0,0 @@ -This is a temp file \ No newline at end of file