3 -- Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 -- Copyright (C) 2010 Paul Kocialkowski <contact@paulk.fr>
6 -- This file is part of libquvi-scripts <http://quvi.sourceforge.net/>.
8 -- This library is free software; you can redistribute it and/or
9 -- modify it under the terms of the GNU Lesser General Public
10 -- License as published by the Free Software Foundation; either
11 -- version 2.1 of the License, or (at your option) any later version.
13 -- This library is distributed in the hope that it will be useful,
14 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
15 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 -- Lesser General Public License for more details.
18 -- You should have received a copy of the GNU Lesser General Public
19 -- License along with this library; if not, write to the Free Software
20 -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 -- Identify the script.
26 package
.path
= self
.script_dir
.. '/?.lua'
27 local C
= require
'quvi/const'
29 r
.domain
= "tagtele%.com"
31 r
.categories
= C
.proto_http
32 local U
= require
'quvi/util'
33 r
.handles
= U
.handles(self
.page_url
, {r
.domain
}, {"/videos/voir/%d+"})
37 -- Query available formats.
38 function query_formats(self
)
39 self
.formats
= 'default'
45 self
.host_id
= "tagtele"
47 local p
= quvi
.fetch(self
.page_url
)
49 self
.title
= p
:match("<title>TagTélé%s+-%s+(.-)</title>")
50 or error("no match: media title")
52 self
.id
= self
.page_url
:match('/voir/(%d+)')
53 or error("no match: media ID")
55 local pl_url
= "http://www.tagtele.com/videos/playlist/"..self
.id
.."/"
56 local pl
= quvi
.fetch(pl_url
, {fetch_type
='playlist'})
58 self
.url
= {pl
:match("<location>(.-)</")
59 or error("no match: media URL")}
64 -- vim: set ts=4 sw=4 tw=72 expandtab: