Advertisement
Logikos

!info script to get info about video in chat

Feb 17th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1.  
  2. on $*:text:/^[!](qinfo|info|now|nowplaying|tellmewhatthefuckimwatching|whatthefuckamiwatching|whoisthis|tellmethepanel|whoaretheguests|pleasetellmewhoiamwatching|qi)/Si:#: {
  3.  
  4. sockclose vlc
  5. sockopen vlc 192.168.1.30 8080
  6. }
  7. on *:sockopen:vlc: {
  8. if $sockerr > 0 { echo -at vlc not running | sockclose vlc }
  9. sockwrite -n $sockname GET /requests/status.xml HTTP/1.1
  10. sockwrite -n $sockname Host: localhost
  11. sockwrite -n $sockname Connection: Keep-Alive
  12. sockwrite -n $sockname $crlf
  13. }
  14. on *:sockread:vlc: {
  15. if $sockerr > 0 { echo -a error | sockclose vlc }
  16. sockread %vlcx
  17.  
  18.  
  19. if (*name='filename'>* iswm %vlcx) {
  20.  
  21. if ($regex(%vlcx,<info name='filename'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
  22. set %vlcann1 $regml(1)
  23.  
  24.  
  25. }
  26. }
  27.  
  28. if (*name='Frame rate'>* iswm %vlcx) {
  29. if ($regex(%vlcx,<info name='Frame rate'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
  30. var %vlcann2 $regml(1)
  31. }
  32. }
  33.  
  34. if (*name='artist'>* iswm %vlcx) {
  35.  
  36. if ($regex(%vlcx,<info name='artist'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
  37. set %vlcann4 $regml(1)
  38. }
  39. }
  40.  
  41. if (*name='Codec'>* iswm %vlcx) {
  42. if ($regex(%vlcx,<info name='Codec'>\s*\K(.+?)(?=\s*<\/info>)) == 1) {
  43. var %vlcann3 $regml(1)
  44. /describe #qi_interesting Now Playing - [[ %vlcann11 $+($chr(40),%vlc.time,$chr(41),|,$chr(40),%vlc.length,$chr(41)) ]:: With Panel/Guests::[ %vlcann4 ]]
  45.  
  46. unset %vlcann1
  47. unset %vlcann4
  48. }
  49. }
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement