From: Toni Gundogdu Date: Fri, 8 Feb 2013 16:16:13 +0000 (+0200) Subject: ard.lua: Cleanup Ard.iter_formats X-Git-Tag: v0.4.12~10^2~1 X-Git-Url: https://repo.or.cz/w/libquvi-scripts.git/commitdiff_plain/99b37229457931cb2a7b6aa5c65b09443c83b22f ard.lua: Cleanup Ard.iter_formats Realign, remove webX extraction which is now done in Ard.quality_from, make the for loop more compact. Signed-off-by: Toni Gundogdu --- diff --git a/share/lua/website/ard.lua b/share/lua/website/ard.lua index cec5d69..7a3a8ac 100644 --- a/share/lua/website/ard.lua +++ b/share/lua/website/ard.lua @@ -151,29 +151,17 @@ function Ard.iter_formats(page) for prefix, suffix in page:gmatch(s) do local u = prefix .. suffix - -- remove querystring - u = u:match('^(.-)?') or u - - -- .webs. or Web-S or .s. - local webx = suffix:match('%.web(%w)%.') or suffix:match('%.(%w)%.') - or suffix:match('[=%.]Web%-(%w)') - if webx then webx = 'web' .. webx:lower() end - + u = u:match('^(.-)?') or u -- remove querystring local t = { - container = Ard.container_from(suffix), - encoding = suffix:match('%.(h264)%.'), - quality = Ard.quality_from(suffix), - height = Ard.height_from(suffix), - webx = webx, - url = u - } + container = Ard.container_from(suffix), + encoding = suffix:match('%.(h264)%.'), + quality = Ard.quality_from(suffix), + height = Ard.height_from(suffix), + url = u + } table.insert(r,t) end - - if #r == 0 then - error('no media urls found') - end - + if #r == 0 then error('no media urls found') end return r end