From b7e1eeb8289e8519b1d4d452978dbe4915ef10d2 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 11 Jan 2014 16:36:30 +0100 Subject: quvi: Add script for zdfmediathek For now the script does only output the veryhigh quality mp4 url. This format features h264 and aac encoding, so vaapi can be used to accelerate. --- .../libquvi-scripts/lua/website/zdfmediathek.lua | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .local/share/libquvi-scripts/lua/website/zdfmediathek.lua diff --git a/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua b/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua new file mode 100644 index 0000000..3499323 --- /dev/null +++ b/.local/share/libquvi-scripts/lua/website/zdfmediathek.lua @@ -0,0 +1,47 @@ +-- Identify the script. +function ident(self) + package.path = self.script_dir .. '/?.lua' + local C = require 'quvi/const' + local r = {} + r.domain = "zdf%.de" + r.formats = "default|best" + r.categories = C.proto_rtmp + local U = require 'quvi/util' + r.handles = U.handles(self.page_url, {r.domain}, + {"/ZDFmediathek/beitrag/video/"}) + return r +end + +-- Query available formats. +function query_formats(self) + self.formats = "default|best" + + return self +end + +-- Parse media URL. +function parse(self) + self.host_id = "zdfmediathek" + + self.id = self.page_url:match("/ZDFmediathek/beitrag/video/(%d+)") + or error ("no match: media id") + + local xmlwebservice_url = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=" .. self.id + + local c = quvi.fetch(xmlwebservice_url, {fetch_type='config'}) + if c:match('') then + local s = c:match('(.-)[\n<]') + error( (not s) and "no match: error message" or s ) + end + + self.title = c:match('([^<]*)') + or error("no match: media title") + + self.thumbnail_url = c:match('([^<]*)') + + self.url = { c:match('veryhigh[ \n]*(http://nrodl.zdf.de/[^<]*\.mp4)') } + + return self +end + +-- vim: set ts=4 sw=4 tw=72 expandtab: -- cgit