Skip to content

Instantly share code, notes, and snippets.

@shashi
Created August 4, 2009 09:25
Show Gist options
  • Save shashi/161130 to your computer and use it in GitHub Desktop.
Save shashi/161130 to your computer and use it in GitHub Desktop.
# Ugly hack for LyricWiki API.
# Steps:
# Open /usr/lib/python2.6/site-packages/sonata/info.py
# (python2.5, or any proper version should be substituted)
# Search for:
# "lyrics = self.lyricServer.getSong"
# Add this in the next line:
lyrics = urllib.urlopen("http://lyricwiki.org/"+self.lyricwiki_format(search_artist)+":"+self.lyricwiki_format(search_title)).read().split("<div class='lyricbox' >")[1].split("</div>")[0].replace('<br />',"\n")
# Care to indent it as the above line.
# In versions greater than 1.6 you can place this line
# carefully in an appropriate position so
# that the "lyrics" variable get the lyrics b4 being printed
# or written into cache file.
# NOTE: This only works for Sonata 1.6,
# I don't think it will work for any other version.
# This is a temperory fix. Be sure to update sonata
# when update is available, then the problem will
# be permanently (hopefully) fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment