Fix lyrics fetchers

master
Andrzej Rybczak 6 years ago
parent 31ee76e8ee
commit d86c965143
  1. 2
      src/lyrics_fetcher.cpp
  2. 6
      src/lyrics_fetcher.h

@ -240,7 +240,7 @@ LyricsFetcher::Result GoogleLyricsFetcher::fetch(const std::string &artist,
return result; return result;
} }
auto urls = getContent("<A HREF=\"(.*?)\">here</A>", data); auto urls = getContent("<A HREF=\"http://www.google.com/url\\?q=(.*?)\">here</A>", data);
if (urls.empty() || !isURLOk(urls[0])) if (urls.empty() || !isURLOk(urls[0]))
{ {

@ -103,10 +103,10 @@ protected:
struct Sing365Fetcher : public GoogleLyricsFetcher struct Sing365Fetcher : public GoogleLyricsFetcher
{ {
virtual const char *name() const override { return "sing365.com"; } virtual const char *name() const override { return "lyrics007.com"; }
protected: protected:
virtual const char *regex() const override { return "<div class=\"content\">.*?</script></div>(.*?)<script>"; } virtual const char *regex() const override { return "<div class=\"lyrics\">(.*?)</div>"; }
}; };
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
@ -162,7 +162,7 @@ struct ZeneszovegFetcher : public GoogleLyricsFetcher
virtual const char *name() const override { return "zeneszoveg.hu"; } virtual const char *name() const override { return "zeneszoveg.hu"; }
protected: protected:
virtual const char *regex() const override { return "<div class=\"lyrics-plain-text\">(.*?)</div>"; } virtual const char *regex() const override { return "<div class=\"lyrics-plain-text.*?\">(.*?)</div>"; }
}; };
struct InternetLyricsFetcher : public GoogleLyricsFetcher struct InternetLyricsFetcher : public GoogleLyricsFetcher

Loading…
Cancel
Save