This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/youtube_dl.lua

22 lines
625 B
Lua
Raw Normal View History

2015-05-24 18:23:30 +02:00
function run_bash(str)
local cmd = io.popen(str)
local result = cmd:read('*all')
cmd:close()
return result
end
function run(msg, matches)
URL = matches[1]
local receiver = get_receiver(msg)
2015-05-27 18:55:36 +02:00
text = run_bash("rm tmp/video.mp4 && youtube-dl -o tmp/video.mp4 " .. URL)
2015-05-24 18:23:30 +02:00
send_video(get_receiver(msg), "tmp/video.mp4", ok_cb, false)
return 'Video wird gesendet! \nDas kann je nach Video bis zu 10 Minuten dauern!'
end
return {
description = "Downloadet und sendet ein YouTube-Video",
2015-05-27 18:55:36 +02:00
usage = {"/ydl [Link]"},
2015-05-24 18:23:30 +02:00
patterns = {"^/ydl (.*)$"},
run = run
}
--by Akamaru [https://ponywave.de]