2 -- Copyright (C) 2010-2012 Toni Gundogdu <legatvs@gmail.com>
4 -- This file is part of libquvi-scripts <http://quvi.sourceforge.net/>.
6 -- This library is free software; you can redistribute it and/or
7 -- modify it under the terms of the GNU Lesser General Public
8 -- License as published by the Free Software Foundation; either
9 -- version 2.1 of the License, or (at your option) any later version.
11 -- This library is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 -- Lesser General Public License for more details.
16 -- You should have received a copy of the GNU Lesser General Public
17 -- License along with this library; if not, write to the Free Software
18 -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 local Gaskrank
= {} -- Utility functions unique to this script
24 -- Identify the media script.
26 local A
= require
'quvi/accepts'
27 local C
= require
'quvi/const'
29 accepts
= A
.accepts(qargs
.input_url
, {"gaskrank%.tv"}, {"/tv/"}),
30 categories
= C
.proto_http
35 -- Parse media properties.
37 local p
= quvi
.fetch(qargs
.input_url
)
39 qargs
.thumb_url
= p
:match('"og:image" content="(.-)"') or ''
41 qargs
.title
= p
:match('"og:title" content="(.-)"') or ''
43 qargs
.id
= qargs
.input_url
:match("%-(%d+)%.h")
44 or error("no match: media ID")
46 qargs
.streams
= Gaskrank
.iter_streams(p
)
55 function Gaskrank
.iter_streams(p
)
56 local u
= p
:match("(http://movies.-%.flv)")
57 or error("no match: media stream URL")
58 local S
= require
'quvi/stream'
59 return {S
.stream_new(u
)}
62 -- vim: set ts=4 sw=4 tw=72 expandtab: