summaryrefslogtreecommitdiff
path: root/src/lyrics_fetcher.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2010-08-11 13:34:18 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2010-08-11 13:34:47 +0200
commit68a7d11c0e9d73383f89663748574ef6816e512d (patch)
tree7c8b5794f65c337d0d6c147a10d6bd47494858e7 /src/lyrics_fetcher.cpp
parentde5f3b22e06460b3a2a3846ed07ad61235bf9b92 (diff)
lyrics fetcher: add songlyrics.com and lyriczz.com support
Diffstat (limited to 'src/lyrics_fetcher.cpp')
-rw-r--r--src/lyrics_fetcher.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lyrics_fetcher.cpp b/src/lyrics_fetcher.cpp
index 40012642..d0c4200b 100644
--- a/src/lyrics_fetcher.cpp
+++ b/src/lyrics_fetcher.cpp
@@ -31,6 +31,8 @@
LyricsFetcher *lyricsPlugins[] =
{
new LyricwikiFetcher(),
+ new LyriczzFetcher(),
+ new SonglyricsFetcher(),
new LyricsmaniaFetcher(),
new LyricstimeFetcher(),
new MetrolyricsFetcher(),
@@ -183,6 +185,11 @@ LyricsFetcher::Result GoogleLyricsFetcher::fetch(const std::string &artist, cons
return LyricsFetcher::fetch("", "");
}
+bool GoogleLyricsFetcher::notLyrics(const std::string &data)
+{
+ return LyricsFetcher::notLyrics(data);
+}
+
bool GoogleLyricsFetcher::isURLOk(const std::string &url)
{
return url.find(getSiteKeyword()) != std::string::npos;
@@ -230,5 +237,16 @@ void LyricsmaniaFetcher::postProcess(std::string &data)
LyricsFetcher::postProcess(data);
}
+/**********************************************************************/
+
+void SonglyricsFetcher::postProcess(std::string &data)
+{
+ size_t i = data.find('['), j = data.find(']');
+ if (i != std::string::npos && i != std::string::npos)
+ data.replace(i, j-i+2, "");
+ data = unescapeHtmlUtf8(data);
+ LyricsFetcher::postProcess(data);
+}
+
#endif // HAVE_CURL_CURL_H