Advertisement
elirang

mIRC VLC now playing

Dec 31st, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.04 KB | None | 0 0
  1. alias np {
  2.   sockclose vlc
  3.   sockopen vlc localhost 8080
  4. }
  5.  
  6. on *:sockopen:vlc:{
  7.   if $sockerr > 0 { echo -at vlc not running | sockclose vlc }
  8.   sockwrite -n $sockname GET /requests/status.xml HTTP/1.1
  9.   sockwrite -n $sockname Host: localhost
  10.   sockwrite -n $sockname Authorization: Basic $encode(:XXX,m)    ;  password comes after colon
  11.   sockwrite -n $sockname Connection: Keep-Alive
  12.   sockwrite -n $sockname $crlf
  13.   echo -at %vlcx
  14. }
  15.  
  16. on *:sockread:vlc: {
  17.   if $sockerr > 0 { echo -a error | sockclose vlc }
  18.   sockread %vlcx
  19.   if ($regex(%vlcx,<info name='title'>(.*?)</info>)) {
  20.     set %title $regml(1)
  21.   }
  22.   if ($regex(%vlcx,<info name='artist'>(.*?)</info>)) {
  23.     set %artist $regml(1)
  24.   }
  25.   if ($regex(%vlcx,<info name='Bitrate'>(.*?)</info>)) {
  26.     set %bitrate $regml(1)
  27.   }
  28.   if ($regex(%vlcx,<length>(.*?)</length>)) {
  29.     set %length $regml(1)
  30.   }
  31.   if (</root> iswm %vlcx) {
  32.     msg $active is now Playing: %artist - %title @ %bitrate Length: $duration(%length)
  33.     unset %artist %title %bitrate %vlcx %length
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement