mIRC Home    About    Download    Register    News    Help

Print Thread
#248780 24/10/14 01:32 AM
Joined: Oct 2014
Posts: 2
A
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Oct 2014
Posts: 2
I have loaded the following script for showing the file played in vlc.

Code:
menu channel {
  Now Playing: {
    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 Authorization: Basic $encode(:password,m)
  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
    }
  }
}


However it doesn't work, the script loads correctly since the VARIABLES tab shows a variable called vlcann1 (see code) with the file played but it doesn't show the msg in the channel.

I have also activated the web interface in vlc. I am using mIRC 6.35

Thanks in advance.

Joined: Oct 2014
Posts: 2
A
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Oct 2014
Posts: 2
I got it working, just changed "Codec" and "Frame resolution" to their counterpart in spanish and it works now.

I noticed it seeing the xml file generated in the http server by VLC.

Hope it would be useful for someone else.


Link Copied to Clipboard