From cb2de3cab142dd24993b01908281e3f884871335 Mon Sep 17 00:00:00 2001 From: PaulK Date: Fri, 20 Apr 2012 14:32:05 +0200 Subject: [PATCH] Added support for empflix.com (NSFW website) --- share/Makefile.am | 1 + share/lua/website/empflix.lua | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 share/lua/website/empflix.lua diff --git a/share/Makefile.am b/share/Makefile.am index 7671d0d..76b1381 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -53,6 +53,7 @@ DIST_lua=\ if WITH_NSFW DIST_lua+=\ + lua/website/empflix.lua \ lua/website/keezmovies.lua \ lua/website/pornhub.lua \ lua/website/spankwire.lua \ diff --git a/share/lua/website/empflix.lua b/share/lua/website/empflix.lua new file mode 100644 index 0000000..28774be --- /dev/null +++ b/share/lua/website/empflix.lua @@ -0,0 +1,63 @@ + +-- libquvi-scripts +-- Copyright (C) 2012 Paul Kocialkowski +-- +-- 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 +-- + +-- Identify the script. +function ident(self) + package.path = self.script_dir .. '/?.lua' + local C = require 'quvi/const' + local r = {} + r.domain = "empflix%.com" + r.formats = "default" + r.categories = C.proto_http + local U = require 'quvi/util' + r.handles = U.handles(self.page_url, {r.domain}, {"/videos/"}) + return r +end + +-- Query available formats. +function query_formats(self) + self.formats = 'default' + return self +end + +-- Parse media URL. +function parse(self) + self.host_id = "empflix" + local page = quvi.fetch(self.page_url) + + self.title = page:match('name="title"%s+value="(.-)"') + or error("no match: media title") + + local c_url = page:match('name="config"%s+value="(.-)"') + or error("no match: config URL") + + local c = quvi.fetch(c_url, {fetch_type = 'config'}) + + self.id = c:match('(.-)') or error("no match: media ID") + self.thumbnail_url = c:match('(.-)(.-)') + or error("no match: media stream URL")} + return self +end + +-- vim: set ts=4 sw=4 tw=72 expandtab: -- 2.11.4.GIT