Skip to content

Instantly share code, notes, and snippets.

@hezhao
Last active December 12, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hezhao/4780125 to your computer and use it in GitHub Desktop.
Save hezhao/4780125 to your computer and use it in GitHub Desktop.
XBMC get current music info (artist and song title)
# WARNING: here getArtist() implicitly converts unicode into str...
self.tag = player.getMusicInfoTag()
artist = self.tag.getArtist()
title = self.tag.getTitle()
# skip weird cases when music stop (title == '') or is streaming (title == 'Streaming...')
if not title or title.lower() == 'streaming...':
print 'title = ' + title
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment