Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- __module_name__ = "Banshee Info"
- __module_version__ = "0.3"
- __module_description__ = "Banshee Info Script"
- import xchat
- import commands
- def banshee(word,word_eol,userdata):
- artist = commands.getoutput("banshee --query-artist | cut -c 9-")
- album = commands.getoutput("banshee --query-album | cut -c 8-")
- title = commands.getoutput("banshee --query-title | cut -c 8-")
- bit = commands.getoutput("banshee --query-bit-rate | cut -c 11-")
- year = commands.getoutput("banshee --query-year | cut -c 7-")
- version = commands.getoutput("banshee --version | grep banshee | cut -c 1-19")
- position = commands.getoutput("banshee --query-position | cut -c 11-13 | tr -d [:punct:]")
- duration = commands.getoutput("banshee --query-duration | cut -c 11-13")
- operc = int(duration) /60
- omp = int(duration) % 60
- eperc = int(position) / 60
- emp = int(position) % 60
- if emp < 10: emp = "0" + str(emp)
- else: emp = emp
- if omp < 10: omp = "0" + str(omp)
- else: omp = omp
- if year == "": xchat.command("me éppen a(z) " + title + " című számot hallgatja " + artist + " előadó " + album + " című albumáról. [" + str(operc) + ":" + str(omp) + "/" + str(eperc) + ":" + str(emp) + "] (" + bit + " kbit/s) :: " + version)
- else:
- if album == "": xchat.command("me éppen a(z) " + title + " című számot hallgatja " + artist + " előadótól. [" + str(operc) + ":" + str(omp) + "/" + str(eperc) + ":" + str(emp) + "] (" + bit + " kbit/s) :: " + version)
- else: xchat.command("me éppen a(z) " + title + " című számot hallgatja " + artist + " előadó " + album + " (" + year + ") című albumáról. [" + str(operc) + ":" + str(omp) + "/" + str(eperc) + ":" + str(emp) + "] (" + bit + " kbit/s) :: " + version)
- return xchat.EAT_ALL
- xchat.hook_command("banshee", banshee, help="Kiírja a Banshee által lejátszott zeneszám adatait.")
- print "XChat2 Banshee Info Script Betöltve"
- # Másold be a ./xchat2 mappába valami.py néven
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement