lyrics fetcher: update sing365 fetcher
This commit is contained in:
@@ -203,8 +203,6 @@ LyricsFetcher::Result GoogleLyricsFetcher::fetch(const std::string &artist, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = unescapeHtmlUtf8(urls[0]);
|
data = unescapeHtmlUtf8(urls[0]);
|
||||||
//result.second = data;
|
|
||||||
//return result;
|
|
||||||
|
|
||||||
URL = data.c_str();
|
URL = data.c_str();
|
||||||
return LyricsFetcher::fetch("", "");
|
return LyricsFetcher::fetch("", "");
|
||||||
@@ -217,6 +215,15 @@ bool GoogleLyricsFetcher::isURLOk(const std::string &url)
|
|||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
|
void Sing365Fetcher::postProcess(std::string &data)
|
||||||
|
{
|
||||||
|
// throw away ad
|
||||||
|
data = boost::regex_replace(data, boost::regex("<div.*</div>"), "");
|
||||||
|
LyricsFetcher::postProcess(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
void MetrolyricsFetcher::postProcess(std::string &data)
|
void MetrolyricsFetcher::postProcess(std::string &data)
|
||||||
{
|
{
|
||||||
// throw away [ from ... ] info
|
// throw away [ from ... ] info
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ struct Sing365Fetcher : public GoogleLyricsFetcher
|
|||||||
virtual const char *name() { return "sing365.com"; }
|
virtual const char *name() { return "sing365.com"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual const char *regex() { return "<div style=\"font-size: 14px;\">(.*?)</div>"; }
|
virtual const char *regex() { return "<script src=\"//srv.tonefuse.com/showads/showad.js\"></script>(.*?)<script>\n/\\* Sing365 - Below Lyrics"; }
|
||||||
|
|
||||||
|
virtual void postProcess(std::string &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
|
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
|
||||||
|
|||||||
Reference in New Issue
Block a user