summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-09-14 11:07:29 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-09-14 11:07:29 +0200
commit89998b09d981975bac731304df034d4e57a88ede (patch)
treeb6871f45701b74f6365d79755b9abc204bf2e7e8
parent1ba734147747ef60f09aba2613125ffce23f1802 (diff)
downloaddotfiles-89998b09d981975bac731304df034d4e57a88ede.tar.gz
dotfiles-89998b09d981975bac731304df034d4e57a88ede.tar.bz2
dotfiles-89998b09d981975bac731304df034d4e57a88ede.zip
Add quvi script for ulmen.tv
Currently only handles stuckrad-barre videos.
l---------.local/share/libquvi-scripts/lua/website/quvi1
-rw-r--r--.local/share/libquvi-scripts/lua/website/ulmentv.lua45
2 files changed, 46 insertions, 0 deletions
diff --git a/.local/share/libquvi-scripts/lua/website/quvi b/.local/share/libquvi-scripts/lua/website/quvi
new file mode 120000
index 0000000..bd3c155
--- /dev/null
+++ b/.local/share/libquvi-scripts/lua/website/quvi
@@ -0,0 +1 @@
+/usr/share/libquvi-scripts/lua/website/quvi/ \ No newline at end of file
diff --git a/.local/share/libquvi-scripts/lua/website/ulmentv.lua b/.local/share/libquvi-scripts/lua/website/ulmentv.lua
new file mode 100644
index 0000000..2173c96
--- /dev/null
+++ b/.local/share/libquvi-scripts/lua/website/ulmentv.lua
@@ -0,0 +1,45 @@
+-- Identify the script.
+function ident(self)
+ package.path = self.script_dir .. '/?.lua'
+ local C = require 'quvi/const'
+ local r = {}
+ r.domain = "ulmen%.tv"
+ r.formats = "default|best"
+ r.categories = C.proto_rtmp
+ local U = require 'quvi/util'
+ r.handles = U.handles(self.page_url, {r.domain}, {"/stuckrad%-barre/%d+/.+$"})
+ 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 = "ulmentv"
+
+ local c = quvi.fetch(self.page_url, {fetch_type='config'})
+ if c:match('<error>') then
+ local s = c:match('<message>(.-)[\n<]')
+ error( (not s) and "no match: error message" or s )
+ end
+
+ self.title = c:match('<meta content="([^"]*)" property="og:title"')
+ or error("no match: media title")
+
+ self.thumbnail_url = c:match('<meta content="([^"]*)" property="og:image"')
+ or error("no match: thumbnail")
+
+ self.id = c:match('<a href="#" data%-url="([^"]*)"')
+ or error("no match: request data url")
+
+ self.url = { "rtmp://178.23.127.5:1935/vod/" .. self.id }
+
+ return self
+end
+
+-- vim: set ts=4 sw=4 tw=72 expandtab: