[Slackbuilds-users] Sonata
Cowyn Li
cowynli at gmail.com
Thu Jun 7 11:51:18 UTC 2012
+ Andrew(sonata.SlackBuild maintainer)
On Thu, Jun 7, 2012 at 6:15 PM, Veljko <veljko3 at gmail.com> wrote:
>
> Hi!
>
> I'm using Sonata mpd client, and fetching lyrics is not working. There
> was problem earlier, as mentioned on this list, with URL (changed
> lyricwiki.org to lyrics.wikia.org). Now, search or edit doesn't work,
> and when I changed lyrics.wikia.org to lyrics.wikia.com in
> /usr/lib/python2.6/site-packages/sonata/info.py, edit works. It opens
> page of the song in firefox on wikia.com. Fetching lyrics still doesn't
> work.
>
> Slackware 13.37
> Sonata 1.6.2.1
>
> Does anybody know what could be the problem?
Haven't that installed, but after a manual try from the v1.6.2.1
source, find it works with this modification:
{{{
--- info.py.orig 2012-06-07 19:33:43.000000000 +0800
+++ info.py 2012-06-07 19:43:26.000000000 +0800
@@ -350,7 +350,7 @@
def lyricwiki_editlink(self, songinfo):
artist, title = [self.lyricwiki_format(mpdh.get(songinfo, key))
for key in ('artist', 'title')]
- return
"http://lyricwiki.org/index.php?title=%s:%s&action=edit" % (artist,
title)
+ return
"http://lyrics.wikia.com/index.php?title=%s:%s&action=edit" % (artist,
title)
def get_lyrics_thread(self, search_artist, search_title,
filename_artist, filename_title, song_dir):
filename_artist = misc.strip_all_slashes(filename_artist)
@@ -385,15 +385,15 @@
else:
# Use default filename:
filename =
self.target_lyrics_filename(filename_artist, filename_title, song_dir)
- # Fetch lyrics from lyricwiki.org
+ # Fetch lyrics from lyrics.wikia.com
gobject.idle_add(self.info_show_lyrics,
_("Fetching lyrics..."), filename_artist, filename_title)
try:
- lyricpage =
urllib.urlopen("http://lyricwiki.org/index.php?title=%s:%s&action=edit"
% (self.lyricwiki_format(search_artist),
self.lyricwiki_format(search_title))).read()
+ lyricpage =
urllib.urlopen("http://lyrics.wikia.com/index.php?title=%s:%s&action=edit"
% (self.lyricwiki_format(search_artist),
self.lyricwiki_format(search_title))).read()
content = re.split("<textarea[^>]*>",
lyricpage)[1].split("</textarea>")[0]
if content.startswith("#REDIRECT [["):
- addr =
"http://lyricwiki.org/index.php?title=%s&action=edit" %
urllib.quote(content.split("[[")[1].split("]]")[0])
+ addr =
"http://lyrics.wikia.com/index.php?title=%s&action=edit" %
urllib.quote(content.split("[[")[1].split("]]")[0])
content = urllib.urlopen(addr).read()
- lyrics =
content.split("<lyrics>")[1].split("</lyrics>")[0]
+ lyrics =
content.split("<lyrics>")[1].split("</lyrics>")[0]
if lyrics.strip() != "<!-- PUT
LYRICS HERE (and delete this entire line) -->":
lyrics = misc.unescape_html(lyrics)
lyrics = misc.wiki_to_html(lyrics)
}}}
Notice the last line changed, nasty, kind of, isn't it? No idea about
how page source for lyrics.wikia.com was generated.
Hope this helps.
More information about the SlackBuilds-users
mailing list