From 5cc909b76e3854e7887df90e2fc8bc698513db18 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Mon, 27 Jun 2016 21:24:09 +0200 Subject: [PATCH] =?UTF-8?q?Fixe=20Gr=C3=B6=C3=9Fen-=C3=9Cberschreitungs-Me?= =?UTF-8?q?ldung=20in=20YouTube=5FDL=20(danke=20@Centzilius)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/plugins/youtube_dl.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otouto/plugins/youtube_dl.lua b/otouto/plugins/youtube_dl.lua index 23ead5e..af8d798 100644 --- a/otouto/plugins/youtube_dl.lua +++ b/otouto/plugins/youtube_dl.lua @@ -19,7 +19,7 @@ youtube_dl.command = 'mp3 , /mp4 ' function youtube_dl:convert_video(link) local output = io.popen('youtube-dl -f mp4 --max-filesize 49m -o "/tmp/%(title)s.%(ext)s" '..link):read('*all') print(output) - if string.match(output, '%[download%]File is larger than max-filesize (.*)') then + if string.match(output, '.* File is larger .*') then return 'TOOBIG' end local video = string.match(output, '%[download%] Destination: /tmp/(.*).mp4') @@ -32,7 +32,7 @@ end function youtube_dl:convert_audio(link) local output = io.popen('youtube-dl --max-filesize 49m -o "/tmp/%(title)s.%(ext)s" --extract-audio --audio-format mp3 '..link):read('*all') print(output) - if string.match(output, '%[download%]File is larger than max-filesize (.*)') then + if string.match(output, '.* File is larger .*') then return 'TOOBIG' end local audio = string.match(output, '%[ffmpeg%] Destination: /tmp/(.*).mp3')