Page 1 of 1
Filename to txt
Posted: 25 Nov 2018 17:04
by unstoppz
Hello ,
I dont know is there any plugin like this out, but i couldn't find it, so basicly i want to get filename what is currently played to output to .txt file.
I tryed editing some new playing script plugin but that one was just outputing metadata of songs, but i want real name of file not metadata.
Sorry for bad english.
Here is plugin i saw.
https://addons.videolan.org/p/1172613/
Re: Filename to txt
Posted: 26 Nov 2018 09:46
by chubinou
Hi,
In tools > "media informations", you have the full path of the file in the location field.
Re: Filename to txt
Posted: 26 Nov 2018 09:49
by chubinou
if you want to do it with a Lua script you can use the field ".path" of playlist items.
https://www.videolan.org/developers/vlc ... README.txt
Re: Filename to txt
Posted: 26 Nov 2018 19:15
by unstoppz
can i get location from tools > "media informations" , to be outputed to file so i can read it ?
Re: Filename to txt
Posted: 26 Nov 2018 21:03
by roland1
Code: Select all
--[[
Copyright (C) 2018 roland1
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 3 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, see <https://www.gnu.org/licenses/>.
--]]
-----------------------------------------------------------
-----------------------------------------------------------
local NAME = "nowplaying"
function descriptor()
return {
title = NAME,
version = "0.1",
license = "GPL",
author = "roland1",
shortdesc = NAME.." for vlc 3.0.2",
description = "Writes the current path to a txt file.",
url = "",
capabilities = {"playing-listener", "input-listener"},
}
end
local write
function activate()
local pd = package.config:sub(1, 1)
local prefix = vlc.config.userdatadir():gsub(pd.."*$", pd..NAME)
local fp = prefix..".txt"
write = function(pth)
local fw = assert(io.open(fp,"w"), "Cannot open "..fp)
fw:write(pth)
fw:close()
end
end
local uri0
function input_changed()
local item = assert(vlc.input.item(), "cannot get item")
local uri = assert(item:uri(), "cannot get uri")
if uri == uri0 then
return
end
pcall( write, vlc.strings.decode_uri(vlc.strings.url_parse(uri).path) )
uri0 = uri
end
function playing_changed()
if vlc.playlist.status() == "stopped" then
uri0 = nil
write""
else
input_changed()
end
end
function meta_changed()
end
function deactivate()
write""
end
Re: Filename to txt
Posted: 22 Dec 2018 00:56
by pctechtv
Is there any way to make Filename to txt work with VLC Player 2.2.8? Thanks
Re: Filename to txt
Posted: 23 Dec 2018 19:27
by roland1
There are ways to make it work.
The extension from the first post seems to be open for feature requests (but idk, maybe it is dead), worth trying.