Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1179afb6
Commit
1179afb6
authored
Aug 13, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/meta_engine/luameta.c: Get meta (untested) and artwork using lua scripts.
parent
b2fc1b73
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
681 additions
and
3 deletions
+681
-3
Makefile.am
Makefile.am
+4
-0
configure.ac
configure.ac
+3
-3
modules/meta_engine/luameta.c
modules/meta_engine/luameta.c
+597
-0
share/Makefile.am
share/Makefile.am
+2
-0
share/luameta/README.txt
share/luameta/README.txt
+53
-0
share/luameta/googleimage.lua
share/luameta/googleimage.lua
+22
-0
No files found.
Makefile.am
View file @
1179afb6
...
...
@@ -424,6 +424,10 @@ VLC-release.app: vlc
for
i
in
$(srcdir)
/share/luaplaylist/
*
.
*
;
do
\
$(INSTALL)
-m
644
$
${i}
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/luaplaylist/
`
basename
$
${i}
`
;
\
done
;
\
$(INSTALL)
-d
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/luameta
for
i
in
$(srcdir)
/share/luameta/
*
.
*
;
do
\
$(INSTALL)
-m
644
$
${i}
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/luameta/
`
basename
$
${i}
`
;
\
done
;
\
$(INSTALL)
-d
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/http/dialogs
$(INSTALL)
-d
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/http/js
$(INSTALL)
-d
$(top_builddir)
/VLC-release.app/Contents/MacOS/share/http/old
...
...
configure.ac
View file @
1179afb6
...
...
@@ -1652,9 +1652,9 @@ then
])
if test "x${have_lua}" = "xyes" ; then
AC_DEFINE(HAVE_LUA, [], [Define if you have the lua library])
VLC_ADD_PLUGINS([luaplaylist])
VLC_ADD_LDFLAGS([luaplaylist],[$LUA_LIBS])
VLC_ADD_CFLAGS([luaplaylist],[$LUA_CFLAGS])
VLC_ADD_PLUGINS([luaplaylist
luameta
])
VLC_ADD_LDFLAGS([luaplaylist
luameta
],[$LUA_LIBS])
VLC_ADD_CFLAGS([luaplaylist
luameta
],[$LUA_CFLAGS])
fi
fi
...
...
modules/meta_engine/luameta.c
0 → 100644
View file @
1179afb6
This diff is collapsed.
Click to expand it.
share/Makefile.am
View file @
1179afb6
...
...
@@ -245,6 +245,8 @@ DIST_osdmenu_minimal = \
osdmenu/minimal/fs_panel_mockup.png
DIST_lua
=
\
luameta/README.txt
\
luameta/googleimage.lua
\
luaplaylist/README.txt
\
luaplaylist/dailymotion.lua
\
luaplaylist/youtube.lua
\
...
...
share/luameta/README.txt
0 → 100644
View file @
1179afb6
Instructions to code your own VLC Lua meta script.
$$
Examples: See googleimage.lua .
VLC Lua meta modules should define one of the following functions:
* fetch_art(): returns a path to an artwork for the given item
* fetch_meta(): returns a table with the following items:
.path: the item's full path / URL
.name: the item's name in playlist (OPTIONAL)
.title: the item's Title (OPTIONAL, meta data)
.artist: the item's Artist (OPTIONAL, meta data)
.genre: the item's Genre (OPTIONAL, meta data)
.copyright: the item's Copyright (OPTIONAL, meta data)
.album: the item's Album (OPTIONAL, meta data)
.tracknum: the item's Tracknum (OPTIONAL, meta data)
.description: the item's Description (OPTIONAL, meta data)
.rating: the item's Rating (OPTIONAL, meta data)
.date: the item's Date (OPTIONAL, meta data)
.setting: the item's Setting (OPTIONAL, meta data)
.url: the item's URL (OPTIONAL, meta data)
.language: the item's Language (OPTIONAL, meta data)
.nowplaying: the item's NowPlaying (OPTIONAL, meta data)
.publisher: the item's Publisher (OPTIONAL, meta data)
.encodedby: the item's EncodedBy (OPTIONAL, meta data)
.arturl: the item's ArtURL (OPTIONAL, meta data)
.trackid: the item's TrackID (OPTIONAL, meta data)
.options: a list of VLC options (OPTIONAL)
example: .options = { "fullscreen" }
.duration: stream duration in seconds (OPTIONAL)
.meta: custom meta data (OPTIONAL, meta data)
A .meta field is a table of custom meta categories which
each have custom meta properties.
example: .meta = { ["Google video"] = { ["docid"] = "-5784010886294950089"; ["GVP version"] = "1.1" }; ["misc"] = { "Hello" = "World!" } }
Invalid playlist items will be discarded by VLC.
VLC defines a global vlc object with the following members:
* vlc.stream_new
* vlc.stream_delete
* vlc.stream_readline
* vlc.stream_read
* vlc.msg_dbg( <string> ): print a debug message.
* vlc.msg_warn( <string> ): print a warning message.
* vlc.msg_err( <string> ): print an error message.
* vlc.msg_info( <string> ): print an info message.
Lua scripts are tried in alphabetical order in the user's VLC config
director luameta/ subdirectory, then in the global VLC luameta/
directory.
Lua documentation is available on http://www.lua.org .
VLC uses Lua 5.1
All the Lua standard libraries are available.
share/luameta/googleimage.lua
0 → 100644
View file @
1179afb6
-- Get's an artwork from images.google.com
-- $Id$
-- Replace non alphanumeric char by +
function
get_query
(
)
if
vlc
.
title
then
title
=
vlc
.
title
else
title
=
vlc
.
name
end
vlc
.
msg_dbg
(
title
)
return
title
:
gsub
(
"
[^
(a-z|A-Z|0-9)
]
"
,
"+"
)
end
-- Return the artwork
function
fetch_art
()
fd
=
vlc
.
stream_new
(
"http://images.google.com/images?q="
..
get_query
(
)
)
page
=
vlc
.
stream_read
(
fd
,
65653
)
vlc
.
stream_delete
(
fd
)
_
,
_
,
arturl
=
string.find
(
page
,
"imgurl=([^&]+)"
)
return
arturl
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