Fix für .flv und .mkv
This commit is contained in:
parent
47ce5b8b38
commit
8ce6e87684
@ -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
|
||||
|
Reference in New Issue
Block a user