From: Jeffrey Middleton Date: Tue, 10 Mar 2009 13:49:46 +0000 (-0500) Subject: Fixed lyricwiki plugin X-Git-Tag: release-0.14~69 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=478f17034e0aadcd5aec75d48717fb397f124820;p=ncmpc.git Fixed lyricwiki plugin LyricWiki returns a page with "Not found" in place of the song lyrics if the song is not found; check for this. --- diff --git a/lyrics/02-lyricwiki.rb b/lyrics/02-lyricwiki.rb index a90cb2a..9c9f663 100755 --- a/lyrics/02-lyricwiki.rb +++ b/lyrics/02-lyricwiki.rb @@ -29,4 +29,5 @@ url = "http://lyricwiki.org/api.php" + \ response = Net::HTTP.get(URI.parse(url)) exit(2) unless response =~ /
\s*(.*?)\s*<\/pre>/im
+exit(2) if $1 == "Not found"
 puts $1