Filename to txt

Discuss your Lua playlist, album art and interface scripts.
unstoppz
New Cone
New Cone
Posts: 2
Joined: 25 Nov 2018 16:59

Filename to txt

Postby unstoppz » 25 Nov 2018 17:04

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/

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: Filename to txt

Postby chubinou » 26 Nov 2018 09:46

Hi,

In tools > "media informations", you have the full path of the file in the location field.

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: Filename to txt

Postby chubinou » 26 Nov 2018 09:49

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

unstoppz
New Cone
New Cone
Posts: 2
Joined: 25 Nov 2018 16:59

Re: Filename to txt

Postby unstoppz » 26 Nov 2018 19:15

can i get location from tools > "media informations" , to be outputed to file so i can read it ?

roland1
Blank Cone
Blank Cone
Posts: 44
Joined: 01 May 2014 16:49

Re: Filename to txt

Postby roland1 » 26 Nov 2018 21:03

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

pctechtv
Blank Cone
Blank Cone
Posts: 21
Joined: 11 Jan 2015 02:14

Re: Filename to txt

Postby pctechtv » 22 Dec 2018 00:56

Is there any way to make Filename to txt work with VLC Player 2.2.8? Thanks

roland1
Blank Cone
Blank Cone
Posts: 44
Joined: 01 May 2014 16:49

Re: Filename to txt

Postby roland1 » 23 Dec 2018 19:27

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.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 26 guests