lyrics fetcher: convert lyrics from lyricsmania.com to utf8
This commit is contained in:
@@ -221,5 +221,15 @@ bool MetrolyricsFetcher::isURLOk(const std::string &url)
|
|||||||
return GoogleLyricsFetcher::isURLOk(url) && url.find("sitemap.xml") == std::string::npos;
|
return GoogleLyricsFetcher::isURLOk(url) && url.find("sitemap.xml") == std::string::npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
|
void LyricsmaniaFetcher::postProcess(std::string &data)
|
||||||
|
{
|
||||||
|
// lyricsmania.com uses iso-8859-1 as the encoding
|
||||||
|
// so we need to convert obtained lyrics to utf-8
|
||||||
|
iconv_convert_from_to("iso-8859-1", "utf-8", data);
|
||||||
|
LyricsFetcher::postProcess(data);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // HAVE_CURL_CURL_H
|
#endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ struct LyricsmaniaFetcher : public GoogleLyricsFetcher
|
|||||||
virtual const char *getSiteKeyword() { return "lyricsmania"; }
|
virtual const char *getSiteKeyword() { return "lyricsmania"; }
|
||||||
virtual const char *getOpenTag() { return "</strong> :<br />"; }
|
virtual const char *getOpenTag() { return "</strong> :<br />"; }
|
||||||
virtual const char *getCloseTag() { return "[ <a"; }
|
virtual const char *getCloseTag() { return "[ <a"; }
|
||||||
|
|
||||||
|
virtual void postProcess(std::string &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern LyricsFetcher *lyricsPlugins[];
|
extern LyricsFetcher *lyricsPlugins[];
|
||||||
|
|||||||
Reference in New Issue
Block a user