Last active
September 5, 2022 01:06
-
-
Save elig0n/c0d6e6f3090630823e54e23b90779179 to your computer and use it in GitHub Desktop.
mIRC VLC now playing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias np { | |
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(:XXX,m) ; password comes after colon | |
sockwrite -n $sockname Connection: Keep-Alive | |
sockwrite -n $sockname $crlf | |
echo -at %vlcx | |
} | |
on *:sockread:vlc: { | |
if $sockerr > 0 { echo -a error | sockclose vlc } | |
sockread %vlcx | |
if ($regex(%vlcx,<info name='title'>(.*?)</info>)) { | |
set %title $regml(1) | |
} | |
if ($regex(%vlcx,<info name='artist'>(.*?)</info>)) { | |
set %artist $regml(1) | |
} | |
if ($regex(%vlcx,<info name='Bitrate'>(.*?)</info>)) { | |
set %bitrate $regml(1) | |
} | |
if ($regex(%vlcx,<length>(.*?)</length>)) { | |
set %length $regml(1) | |
} | |
if (</root> iswm %vlcx) { | |
msg $active is now Playing: %artist - %title @ %bitrate Length: $duration(%length) | |
unset %artist %title %bitrate %vlcx %length | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment