From f74bc1ea3ab7ab43e5747f0d4bc6ca39bfc3a756 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 16 Jan 2014 14:35:17 +0100 Subject: quvi/zdf: Add coypright and filter duplicate formats --- .../libquvi-scripts/lua/website/zdfmediathek.lua | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua b/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua index dc4cfb3..4b9e4be 100644 --- a/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua +++ b/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua @@ -1,3 +1,25 @@ + +-- libquvi-scripts +-- Copyright (C) 2014 Benjamin Franzke +-- +-- This file is part of libquvi-scripts . +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library 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 +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +-- 02110-1301 USA +-- + local ZDFmediathek = {} -- Utility functions unique to this script. -- Identify the script. @@ -22,7 +44,9 @@ function query_formats(self) table.sort(fmts, ZDFmediathek.compare_format) for _,f in pairs(fmts) do - table.insert(r, ZDFmediathek.to_s(f)) + local s = ZDFmediathek.to_s(f) + -- There may be duplicates -> filter out + if s ~= r[#r] then table.insert(r,s) end end self.formats = table.concat(r, "|") @@ -73,6 +97,8 @@ function ZDFmediathek.table_add_format(t, fmt) end end + -- HD quality movies are not listed with an http url. + -- But one can build it from the rtmp URL given in a .meta file: if fmt.quality == "hd" and fmt.type == "h264_aac_mp4_rtmp_zdfmeta_http" then local new = { type = "h264_aac_mp4_http_na_na", container = "mp4", protocol = "http" } -- cgit