From 3160719474d1566416d361f1fd8383985c5c7609 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 29 Sep 2013 00:40:12 +0300 Subject: [PATCH] FIX: website/funnyordie.lua: Media stream pattern (PORTpt9) Backported from the 0.9 series [364ad53]. Signed-off-by: Toni Gundogdu --- share/lua/website/funnyordie.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/lua/website/funnyordie.lua b/share/lua/website/funnyordie.lua index 4fbe4ac..a9939af 100644 --- a/share/lua/website/funnyordie.lua +++ b/share/lua/website/funnyordie.lua @@ -85,11 +85,14 @@ function FunnyOrDie.iter_formats(page) for u in page:gmatch('type: "video/mp4", src: "(.-)"') do table.insert(t, u) end + for u in page:gmatch('source src="(.-)"') do table.insert(t,u) end if #t ==0 then error('no match: media stream URL') end local r = {} for _,u in pairs(t) do local q,c = u:match('/(%w+)%.(%w+)$') - table.insert(r, {url=u, quality=q, container=c}) + if q and c then + table.insert(r, {url=u, quality=q, container=c}) + end end return r end -- 2.11.4.GIT