--no-continue

This commit is contained in:
Akamaru 2015-06-29 21:11:47 +02:00
parent e332ef1dc6
commit c530267130
2 changed files with 3 additions and 3 deletions

View File

@ -1,18 +1,19 @@
-- Requires: (sudo) apt-get install youtube-dl -- Requires: (sudo) apt-get install youtube-dl
-- See https://github.com/rg3/youtube-dl/blob/master/README.md#options
function run(msg, matches) function run(msg, matches)
URL = matches[1] URL = matches[1]
local receiver = get_receiver(msg) local receiver = get_receiver(msg)
if string.match(msg.text, '"') then if string.match(msg.text, '"') then
return 'Vergiss es' return 'Vergiss es'
else 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) 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!' return URL .. ' wurde gedownloadet und wird jetzt gesendet! \nDas kann je nach Video sehr lang dauern! \nAlso habt Geduld!'
end end
end end
return { return {
description = "Downloadet und sendet die mp3 von einem YouTube-Video", description = "Downloadet und sendet die MP3 von einem YouTube-Video",
usage = {"/mp3 [Link]"}, usage = {"/mp3 [Link]"},
patterns = {"^/mp3 (https?://[%w-_%.%?%.:/%+=&]+)$"}, patterns = {"^/mp3 (https?://[%w-_%.%?%.:/%+=&]+)$"},
run = run run = run

View File

@ -1 +0,0 @@
This is a temp file