]> git.sesse.net Git - vlc/blob - share/lua/meta/art/02_frenchtv.lua
Lua: fix the remaining scripts.
[vlc] / share / lua / meta / art / 02_frenchtv.lua
1 --[[
2  Gets an artwork from amazon
3
4  $Id$
5  Copyright © 2007 the VideoLAN team
6
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU General Public License for more details.
16
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20 --]]
21
22 -- Return the artwork
23 function fetch_art()
24     local urlsForChannel = {
25     -- on http://cyril.bourreau.free.fr/Vectoriel/
26         ["TF1"] = "http://cyril.bourreau.free.fr/Vectoriel/TF1-2006.png",
27         ["France 2"] = "http://cyril.bourreau.free.fr/Vectoriel/FR2-DSK-couleur.png",
28         ["France 3"] = "http://cyril.bourreau.free.fr/Vectoriel/FR3-DSK-couleur.png",
29         ["France 4"] = "http://cyril.bourreau.free.fr/Vectoriel/FR4-DSK-couleur.png",
30         ["France 5"] = "http://cyril.bourreau.free.fr/Vectoriel/FR5-DSK-couleur.png",
31         ["Direct 8"] = "http://cyril.bourreau.free.fr/Vectoriel/Direct8-2009.png",
32         ["NRJ 12"] = "http://cyril.bourreau.free.fr/Vectoriel/NRJ12-2009.png",
33         ["iTele"] = "http://cyril.bourreau.free.fr/Vectoriel/iTELE-2008.png",
34         ["W9"] = "http://cyril.bourreau.free.fr/Vectoriel/W9.png",
35
36         ["Arte"] = "http://www.artepro.com/fr_fichiers/upload/10594.jpg",
37         ["TMC"] = "http://upload.wikimedia.org/wikipedia/fr/4/4b/Logo_de_TMC.gif",
38         ["i> TELE"] = "http://upload.wikimedia.org/wikipedia/fr/5/56/Logo_I_tele.png",
39         ["BFM TV"] = "http://upload.wikimedia.org/wikipedia/fr/3/30/Bfm_tv.jpg",
40         ["Virgin 17"] = "http://upload.wikimedia.org/wikipedia/fr/3/39/Virgin17logo.png",
41         ["La Chaîne Parlementaire"] = "http://upload.wikimedia.org/wikipedia/fr/9/98/Public-Senat-LCP-An_logo_2010.png"
42     }
43     local meta = vlc.input.item:metas();
44     local channel
45     if meta["title"] then
46         channel = meta["title"]
47     else
48         channel = meta["filename"]
49     end
50
51     -- Replace "France 2 HD" by "France 2"
52     channel = string.gsub(channel, "^(.-)%sHD%s*$", "%1")
53
54     -- Replace "France 2 (bas débit)" by "France 2"
55     channel = string.gsub(channel, "^(.-)%s%(bas débit%)%s*$", "%1")
56
57     -- trim
58     channel = string.gsub(channel, "^%s*(.-)%s*$", "%1")
59
60     return urlsForChannel[channel]
61 end