From: Toni Gundogdu Date: Wed, 21 Nov 2012 11:08:02 +0000 (+0200) Subject: FIX: break.lua: multiple patterns X-Git-Tag: v0.4.10~6 X-Git-Url: https://repo.or.cz/w/libquvi-scripts.git/commitdiff_plain/6357cd1853192677b59e329beb5ca9e8376e8638 FIX: break.lua: multiple patterns Fix {title,id,filepath,filehash} patterns. Add thumbnail_url. Signed-off-by: Toni Gundogdu --- diff --git a/share/lua/website/break.lua b/share/lua/website/break.lua index 6a6ea16..bfae9c0 100644 --- a/share/lua/website/break.lua +++ b/share/lua/website/break.lua @@ -45,19 +45,21 @@ function parse(self) local p = quvi.fetch(self.page_url) - self.title = p:match('id="vid_title" content="(.-)"') + self.title = p:match("sVidTitle:%s+['\"](.-)['\"]") or error("no match: media title") - self.id = p:match("ContentID='(.-)'") + self.id = p:match("iContentID:%s+'(.-)'") or error("no match: media ID") - local fn = p:match("FileName='(.-)'") - or error("no match: file name") + self.thumbnail_url = p:match('"og:image" content="(.-)"') or '' - local fh = p:match('flashVars.icon = "(.-)"') + local n = p:match("videoPath:%s+['\"](.-)['\"]") + or error("no match: file path") + + local h = p:match("icon:%s+['\"](.-)['\"]") or error("no match: file hash") - self.url = {string.format("%s.flv?%s", fn, fh)} + self.url = {string.format("%s?%s", n, h)} return self end