From: Antoine Cellerier Date: Sat, 13 Feb 2010 16:48:57 +0000 (+0100) Subject: New dumpmeta lua interface module to dump a file's meta data on stdout/stderr (I... X-Git-Tag: 1.1.0-ff~111 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1fac125aa2d25b8a1323eb070e0c7e43edfb30ad;p=vlc New dumpmeta lua interface module to dump a file's meta data on stdout/stderr (I'll let you figure out which one it is). Use as: vlc -I lua --lua-intf dumpmeta filename.mp3 --- diff --git a/share/Makefile.am b/share/Makefile.am index c55124f3a6..e7d70d3500 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -220,6 +220,7 @@ DIST_lua= \ lua/intf/modules/host.lua \ lua/intf/telnet.lua \ lua/intf/dummy.lua \ + lua/intf/dumpmeta.lua \ lua/modules/sandbox.lua \ lua/modules/simplexml.lua diff --git a/share/lua/intf/dumpmeta.lua b/share/lua/intf/dumpmeta.lua new file mode 100644 index 0000000000..194d446b88 --- /dev/null +++ b/share/lua/intf/dumpmeta.lua @@ -0,0 +1,39 @@ +--[==========================================================================[ + rc.lua: remote control module for VLC +--[==========================================================================[ + Copyright (C) 2007-2009 the VideoLAN team + $Id$ + + Authors: Antoine Cellerier + + 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. +--]==========================================================================] + +--[[ to dump meta data information in the debug output, run: + vlc -I lua --lua-intf dumpmeta coolmusic.mp3 +--]] + +local meta +repeat + meta = vlc.input.metas() +until meta + +vlc.msg.info("Dumping meta data") +if meta then + for key, value in pairs(meta) do + vlc.msg.info(key..": "..value) + end +end +vlc.misc.quit()