From 84cb67d05c00b0d4026d329838735240e4b36b41 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sun, 27 May 2012 22:03:43 +0200 Subject: [PATCH] FIX: sapo.lua: ID, media stream URL and title None of ID, URL or title were getting matched with the current sapo.pt design. Example URL: http://videos.sapo.pt/JZOMcU6KPdZV7RTKIphP --- share/lua/website/sapo.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/lua/website/sapo.lua b/share/lua/website/sapo.lua index 48b7f14..85f7d7f 100644 --- a/share/lua/website/sapo.lua +++ b/share/lua/website/sapo.lua @@ -43,15 +43,15 @@ end function parse (self) self.host_id = "sapo" + self.id = self.page_url:match('http://.*sapo.pt/([^?"/]+)') + or error("no match: media ID") + local p = quvi.fetch(self.page_url) - self.title = p:match('class="tit">(.-)') + self.title = p:match('"og:title" content="(.-)%s+%-%s+SAPO') or error("no match: media title") - self.id = p:match('vid=(.-)&') - or error("no match: media ID") - - self.url = {p:match('?file=(.-)&') + self.url = {p:match('videoVerifyMrec%("(.-)"') or error("no match: media URL")} return self -- 2.11.4.GIT