I IRC (as a verb) a lot, and have written a few python plugins for the weechat command line IRC client.
Pymp3 is a weechat plugin to support various music players from a single common interface. It's been in development for over 2 years, slowly gaining in player support. It is well tested (tested with Japanese (日本語) encodings), and should be considered very stable. Right now, it supports the following (8) players:
The script uses the legacy xmms unix socket to communicate with xmms, and beep. Audacious is now supported via DBus, exclusively; you'll need the python-dbus bindings for this and other DBus-only supported players. If you are running a modern distribution that uses Gnome or KDE4, you already have these bindings.
For banshee, the script has to fork and execute a child process to get the information or to control the player. This leads to a small delay; if you really like banshee and want me to experiment with spawning threads to do this, please email me.
Finally, DCOP is being phased out of KDE. This means that Juk (which has not and probably will not be ported to KDE4) will probably eventually be phased out of support, and Amarok 2.0 support will have to wait until I get around to testing it (whenever it hits Ubuntu or Debian).
Commands: /mp3 : announce the currently playing mp3 /mp3 stop : stop playing /mp3 play : start playing /mp3 pause : pause playback /mp3 next [#] : skip to next (# of) track(s) /mp3 prev [#] : skip to prev (# of) track(s) /mp3 open : open files
Note that pause is actually a play toggle, and using it will either pause currently playing music or play currently paused music. stop is a complete stop as in classical players (a pause, releasing the audio hardware, and seeking to the beginning of the song) but this behavior is not even available in banshee, so for banshee stop pauses the track but will not unpause if repeated.
Download a version of pymp (mp3.py)
This script was originally written for xchat. As such, many intermediate versions of it's development are missing here. If you are interested, you can see them on my xchat plugins page Release dates are shown below for releases that did not have weechat support.