Lyrics fetcher: fix metrolyrics.com fetchers
This commit is contained in:
@@ -119,7 +119,12 @@ std::vector<std::string> LyricsFetcher::getContent(const char *regex_,
|
||||
auto first = boost::sregex_iterator(data.begin(), data.end(), rx);
|
||||
auto last = boost::sregex_iterator();
|
||||
for (; first != last; ++first)
|
||||
result.push_back(first->str(1));
|
||||
{
|
||||
std::string content;
|
||||
for (size_t i = 1; i < first->size(); ++i)
|
||||
content += first->str(i);
|
||||
result.push_back(std::move(content));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct MetrolyricsFetcher : public GoogleLyricsFetcher
|
||||
virtual const char *name() const override { return "metrolyrics.com"; }
|
||||
|
||||
protected:
|
||||
virtual const char *regex() const override { return "<div class=\"lyrics-body\">(.*?)</div>"; }
|
||||
virtual const char *regex() const override { return "<div class=\"lyrics-body\">(.*?)<!--WIDGET.*?<!-- Second Section -->(.*?)<!--WIDGET.*?<!-- Third Section -->(.*?)</div>"; }
|
||||
|
||||
virtual bool isURLOk(const std::string &url) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user