lyrics fetcher: remove ad from lyricsvip lyrics
This commit is contained in:
@@ -261,6 +261,19 @@ void SonglyricsFetcher::postProcess(std::string &data)
|
|||||||
LyricsFetcher::postProcess(data);
|
LyricsFetcher::postProcess(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
|
void LyricsvipFetcher::postProcess(std::string &data)
|
||||||
|
{
|
||||||
|
// throw away <div> with ad
|
||||||
|
size_t i = data.find("<div class=\"ad\""), j = data.find("</div>");
|
||||||
|
if (i != std::string::npos && i != std::string::npos)
|
||||||
|
data.replace(i, j-i+static_strlen("</div>"), "");
|
||||||
|
data = unescapeHtmlUtf8(data);
|
||||||
|
LyricsFetcher::postProcess(data);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
LyricsFetcher::Result InternetLyricsFetcher::fetch(const std::string &artist, const std::string &title)
|
LyricsFetcher::Result InternetLyricsFetcher::fetch(const std::string &artist, const std::string &title)
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ struct LyricsvipFetcher : public GoogleLyricsFetcher
|
|||||||
virtual const char *getSiteKeyword() { return "lyricsvip"; }
|
virtual const char *getSiteKeyword() { return "lyricsvip"; }
|
||||||
virtual const char *getOpenTag() { return "</h2>"; }
|
virtual const char *getOpenTag() { return "</h2>"; }
|
||||||
virtual const char *getCloseTag() { return "</td>"; }
|
virtual const char *getCloseTag() { return "</td>"; }
|
||||||
|
|
||||||
|
virtual void postProcess(std::string &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
|
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
|
||||||
|
|||||||
Reference in New Issue
Block a user