Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # usage:
- # type /npv to spam the filename in the current channel
- # - uses /action (or /me) to spam with
- __module_name__ = "SteelGolem's VLC NP spammer"
- __module_version__ = "1.1.0"
- __module_description__ = "VLC Now Playing spammer"
- print "\0034" + __module_name__, __module_version__, "has been loaded\003"
- import xchat, commands
- def command_npv(word, word_eol, userdata):
- pid = commands.getoutput("ps --no-headers -C vlc | awk '{print $1}'")
- procentry = commands.getoutput("ls -l /proc/" + pid + "/fd | egrep '.mkv|.avi|.mpg|.mp3|.wmv|.mp4|.flac|.flv|.webm|.VOB'")
- splitparts = procentry.split('/')
- filename = splitparts[len(splitparts)-1]
- if filename == "":
- print "\0034SG VLC NP error: unknown file type, or nothing loaded\003"
- elif filename == "fd: file not found":
- print "\0034SG VLC NP error: unknown error, document"
- elif filename == "fd: No such file or directory":
- print "\0034SG VLC NP error: VLC not running\003"
- else:
- xchat.command("say VLC NP: " + filename)
- return xchat.EAT_ALL
- xchat.hook_command("NPV", command_npv, help="Displays filename of whatever's playing in VLC.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement