I managed to get a piece of code working well enough with the latest version of VLC.
Make sure you have your http server running in VLC (and restart). (The 127.0.0.1:8080) As this pulls from the generated XML file.
As for setting up IRC, I am going to assume you have that down.
This code works fine for displaying The filename, The encoding, and the Frames per second of the video.
I have it modified for an ontext call,.. in this particular code snippet it is !VidInfo , but change whatever you want for your needs.
Code: Select all
on *:TEXT:!vidinfo*:#: {
sockclose vlc
sockopen vlc localhost 8080
}
on *:sockopen:vlc: {
if $sockerr > 0 { echo -at vlc not running | sockclose vlc }
sockwrite -n $sockname GET /requests/status.xml HTTP/1.1
sockwrite -n $sockname Host: localhost
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
}
on *:sockread:vlc: {
if $sockerr > 0 { echo -a error | sockclose vlc }
sockread %vlcx
;echo -a %vlcx
if (*name='filename'>* iswm %vlcx) {
if ($regex(%vlcx,<info name='filename'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
set %vlcann1 $regml(1)
}
}
if (*name='Frame rate'>* iswm %vlcx) {
if ($regex(%vlcx,<info name='Frame rate'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
var %vlcann2 $regml(1)
}
}
if (*name='Codec'>* iswm %vlcx) {
if ($regex(%vlcx,<info name='Codec'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
var %vlcann3 $regml(1)
msg $active VLC %vlcann1 :: %vlcann3 $+ @ $+ %vlcann2 fps
unset %vlcann1
}
}
}
Hope that helps you out!
Chromatic