From cbc72d8fe0dd4d4984d73de9e9e55800c463624a Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Fri, 12 Aug 2016 21:11:45 +0200 Subject: [PATCH] YouTube_DL: Fehler, wenn Video entfernt wurde/nicht existiert --- otouto/plugins/youtube_dl.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/otouto/plugins/youtube_dl.lua b/otouto/plugins/youtube_dl.lua index e99a72e..8708c38 100644 --- a/otouto/plugins/youtube_dl.lua +++ b/otouto/plugins/youtube_dl.lua @@ -22,6 +22,7 @@ function youtube_dl:get_availabe_formats(id, hash) local ytdl_json = io.popen('youtube-dl -j https://www.youtube.com/watch/?v='..id):read('*all') if not ytdl_json then return end local data = json.decode(ytdl_json) + if not data then return nil end local available_formats = {} redis:hset(hash, 'duration', data.duration)