-- libquvi-scripts v0.9.20131130 -- Copyright (C) 2010-2011,2013 Toni Gundogdu -- -- This file is part of libquvi-scripts . -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU Affero General Public -- License as published by the Free Software Foundation, either -- version 3 of the License, or (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General -- Public License along with this program. If not, see -- . -- -- -- NOTE: Some streams (e.g. 3gp) do not appear to be available (404) even -- if they are listed in the config XML. -- local Spiegel = {} -- Utility functions unique to this script -- Identify the media script. function ident(qargs) return { can_parse_url = Spiegel.can_parse_url(qargs), domains = table.concat({'spiegel.de'}, ',') } end -- Parse the media properties. function parse(qargs) local C = require 'quvi/const' local o = { [C.qoo_fetch_from_charset] = 'iso-8859-1' } local p = quvi.http.fetch(qargs.input_url, o).data qargs.thumb_url = p:match('"og:image" content="(.-)"') or '' qargs.title = p:match('"module%-title">(.-)1 then Spiegel.ch_best(S, r) end return r end function Spiegel.ch_best(S, t) local r = t[1] r.flags.best = true for _,v in pairs(t) do if v.video.height > r.video.height then r = S.swap_best(r, v) end end end function Spiegel.to_id(t) return string.format('%s_%s_%sk_%sp', t.container, t.video.encoding, t.video.bitrate_kbit_s, t.video.height) end -- vim: set ts=2 sw=2 tw=72 expandtab: