From b182505d46c54573706c9d2f78a1d021f8c2949f Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Wed, 21 Nov 2012 14:42:29 +0200 Subject: [PATCH] FIX: audioboo.lua: multiple patterns Fix {title,id,thumbnail,stream} patterns. Parse from the contents of the media URL instead of oembed which no longer appears to provide the media stream URL. Signed-off-by: Toni Gundogdu --- share/lua/website/audioboo.lua | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/share/lua/website/audioboo.lua b/share/lua/website/audioboo.lua index 58a8e5e..550ca3c 100644 --- a/share/lua/website/audioboo.lua +++ b/share/lua/website/audioboo.lua @@ -1,6 +1,6 @@ -- libquvi-scripts --- Copyright (C) 2011 Toni Gundogdu +-- Copyright (C) 2011-2012 Toni Gundogdu -- -- This file is part of libquvi-scripts . -- @@ -43,22 +43,23 @@ end function parse (self) self.host_id = "audioboo" - local oe_url = - "http://audioboo.fm/publishing/oembed.json?url=" .. self.page_url + self.id = self.page_url:match('/boos/(%d+)%-') + or error('no match: media ID') - local oe = quvi.fetch(oe_url, {fetch_type='config'}) + local p = quvi.fetch(self.page_url) - self.title = oe:match('"title":"(.-)"') - or error('no match: media title') + self.title = + p:match('.+content=[\'"](.-)[\'"]%s+property=[\'"]og:title[\'"]') + or error('no match: media title') - self.thumbnail_url = oe:match('"thumbnail_url":"(.-)"') or '' - - self.id = oe:match('id=."boo_embed_(.-)."') - or error('no match: media id') - - self.url = {oe:match('a href=."(.-)."') - or error('no match: media url')} + self.thumbnail_url = + p:match('.+content=[\'"](.-)[\'"]%s+property=[\'"]og:image[\'"]') + or '' + self.url = { + p:match('.+content=[\'"](.-)[\'"]%s+property=[\'"]og:audio[\'"]') + or error('no match: media stream URL') + } return self end -- 2.11.4.GIT