summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2017-05-21 16:08:19 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2017-05-21 16:10:48 +0200
commit99107c5b393e6f54301a8f530ac266c3a95f7878 (patch)
treedd00bcc8f364853a252bcee01254e6a0cebca50a
parent2362770b66a9a4b06080b4c2b24177a21dac017f (diff)
Fix fetching lyrics from sing365.com and genius.com0.8
-rw-r--r--src/lyrics_fetcher.cpp4
-rw-r--r--src/lyrics_fetcher.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lyrics_fetcher.cpp b/src/lyrics_fetcher.cpp
index 1c438f15..2239edce 100644
--- a/src/lyrics_fetcher.cpp
+++ b/src/lyrics_fetcher.cpp
@@ -78,7 +78,7 @@ LyricsFetcher::Result LyricsFetcher::fetch(const std::string &artist,
boost::replace_all(url, "%title%", Curl::escape(title));
std::string data;
- CURLcode code = Curl::perform(data, url);
+ CURLcode code = Curl::perform(data, url, "", true);
if (code != CURLE_OK)
{
@@ -87,7 +87,7 @@ LyricsFetcher::Result LyricsFetcher::fetch(const std::string &artist,
}
auto lyrics = getContent(regex(), data);
-
+
if (lyrics.empty() || notLyrics(data))
{
result.second = msgNotFound;
diff --git a/src/lyrics_fetcher.h b/src/lyrics_fetcher.h
index 695e50f3..15079f5c 100644
--- a/src/lyrics_fetcher.h
+++ b/src/lyrics_fetcher.h
@@ -106,7 +106,7 @@ struct Sing365Fetcher : public GoogleLyricsFetcher
virtual const char *name() const override { return "sing365.com"; }
protected:
- virtual const char *regex() const override { return "<!-Lyrics Begin->(.*?)<!-Lyrics End->"; }
+ virtual const char *regex() const override { return "<div class=\"content\">.*?</script>(.*?)<script>"; }
};
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
@@ -130,7 +130,7 @@ struct GeniusFetcher : public GoogleLyricsFetcher
virtual const char *name() const override { return "genius.com"; }
protected:
- virtual const char *regex() const override { return "<lyrics.*?>(.*?)</lyrics>"; }
+ virtual const char *regex() const override { return "<div class=\"lyrics\">(.*?)</div>"; }
};
struct JahLyricsFetcher : public GoogleLyricsFetcher