lyrics fetcher: skip lyricwiki if there's licence restriction on lyrics
This commit is contained in:
@@ -125,12 +125,18 @@ LyricsFetcher::Result LyricwikiFetcher::fetch(const std::string &artist, const s
|
|||||||
result.second = msgNotFound;
|
result.second = msgNotFound;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
data = unescapeHtmlUtf8(data);
|
||||||
|
if (data.find("Unfortunately, we are not licensed to display the full lyrics for this song at the moment.") != std::string::npos)
|
||||||
|
{
|
||||||
|
result.second = "Licence restriction";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
Replace(data, "<br />", "\n");
|
Replace(data, "<br />", "\n");
|
||||||
StripHtmlTags(data);
|
StripHtmlTags(data);
|
||||||
Trim(data);
|
Trim(data);
|
||||||
|
|
||||||
result.second = unescapeHtmlUtf8(data);
|
result.second = data;
|
||||||
result.first = true;
|
result.first = true;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user