new plugin youtube_dl
This commit is contained in:
parent
595d679d8b
commit
cc64c13884
1
.gitignore
vendored
1
.gitignore
vendored
@ -40,5 +40,4 @@ plugins/youtube_playlist.lua
|
|||||||
plugins/yandere.lua
|
plugins/yandere.lua
|
||||||
plugins/e621.lua
|
plugins/e621.lua
|
||||||
plugins/random.lua
|
plugins/random.lua
|
||||||
plugins/youtube_dl.lua
|
|
||||||
plugins/ponyfaces.lua
|
plugins/ponyfaces.lua
|
22
plugins/youtube_dl.lua
Normal file
22
plugins/youtube_dl.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
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)
|
||||||
|
text = run_bash("youtube-dl -o tmp/video.mp4 " .. URL)
|
||||||
|
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",
|
||||||
|
usage = {"/ydl"},
|
||||||
|
patterns = {"^/ydl (.*)$"},
|
||||||
|
run = run
|
||||||
|
}
|
||||||
|
--by Akamaru [https://ponywave.de]
|
Reference in New Issue
Block a user