Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
1273d738
Commit
1273d738
authored
Jan 13, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: Add a tvrage.lua meta fetcher.
parent
8c8a1cee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
share/Makefile.am
share/Makefile.am
+2
-0
share/lua/meta/fetcher/README.txt
share/lua/meta/fetcher/README.txt
+12
-0
share/lua/meta/fetcher/tvrage.lua
share/lua/meta/fetcher/tvrage.lua
+79
-0
No files found.
share/Makefile.am
View file @
1273d738
...
...
@@ -194,6 +194,8 @@ DIST_lua= \
lua/meta/art/01_musicbrainz.lua
\
lua/meta/art/02_frenchtv.lua
\
lua/meta/art/10_googleimage.lua
\
lua/meta/fetcher/README.txt
\
lua/meta/fetcher/tvrage.lua
\
lua/meta/reader/README.txt
\
lua/meta/reader/filename.lua
\
lua/playlist/README.txt
\
...
...
share/lua/meta/fetcher/README.txt
0 → 100644
View file @
1273d738
Instructions to code your own VLC Lua meta script.
$Id$
See lua/README.txt for generic documentation about Lua usage in VLC.
Examples: See filename.lua .
VLC Lua "meta fetcher" modules should define one of the following functions:
* fetch_meta(): returns a path to an artwork for the given item
Available VLC specific Lua modules: msg, stream, strings, variables, item,
objects and misc. See lua/README.txt
share/lua/meta/fetcher/tvrage.lua
0 → 100644
View file @
1273d738
--[[
Gets metas for tv episode using tvrage.
$Id$
Copyright © 2007 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
-- Replace non alphanumeric char by +
function
get_query
(
title
)
-- If we have a .EXT remove the extension.
str
=
string.gsub
(
title
,
"(.*)%....$"
,
"%1"
)
return
string.gsub
(
str
,
"([^%w ])"
,
function
(
c
)
return
string.format
(
"%%%02X"
,
string.byte
(
c
))
end
)
end
function
fetch_meta
()
local
metas
=
vlc
.
item
.
metas
(
vlc
.
item
)
local
showName
=
metas
[
"showName"
]
if
not
showName
then
return
false
end
local
seasonNumber
=
metas
[
"seasonNumber"
];
if
not
seasonNumber
then
return
false
end
local
episodeNumber
=
metas
[
"episodeNumber"
];
if
not
episodeNumber
then
return
false
end
local
fd
=
vlc
.
stream
(
"http://services.tvrage.com/feeds/search.php?show="
..
get_query
(
showName
))
local
page
=
fd
:
read
(
65653
)
fd
=
nil
_
,
_
,
showid
=
string.find
(
page
,
"<showid>(.-)</showid>"
)
if
not
showid
then
return
false
end
fd
=
vlc
.
stream
(
"http://services.tvrage.com/feeds/full_show_info.php?sid="
..
showid
)
page
=
fd
:
read
(
65653
)
fd
=
nil
_
,
_
,
season
=
string.find
(
page
,
"<Season no=\""..seasonNumber.."
\
">(.-)</Season>"
)
if
not
season
then
return
false
end
_
,
_
,
episode
=
string.find
(
season
,
"<episode>(.-<seasonnum>"
..
episodeNumber
..
"</seasonnum>.-)</episode>"
)
if
not
episode
then
return
false
end
_
,
_
,
title
,
artwork
=
string.find
(
episode
,
"<title>(.-)</title><screencap>(.-)</screencap>"
)
if
not
title
then
return
false
end
vlc
.
item
.
set_meta
(
vlc
.
item
,
"title"
,
showName
..
" S"
..
seasonNumber
..
"E"
..
episodeNumber
..
" - "
..
title
)
vlc
.
item
.
set_meta
(
vlc
.
item
,
"artwork_url"
,
artwork
)
vlc
.
item
.
set_meta
(
vlc
.
item
,
"episodeName"
,
title
)
return
true
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment