mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-02 18:46:46 +01:00
Rename Stands4 to Lyrics.com
This commit is contained in:
parent
c8caea0d30
commit
52c83d592c
@ -51,7 +51,7 @@ Funding developers is a way to contribute to open source projects you appreciate
|
||||
* Edit tags on audio files
|
||||
* Fetch tags from MusicBrainz
|
||||
* Album cover art from [Last.fm](https://www.last.fm/), [Musicbrainz](https://musicbrainz.org/), [Discogs](https://www.discogs.com/), [Musixmatch](https://www.musixmatch.com/), [Deezer](https://www.deezer.com/), [Tidal](https://www.tidal.com/), [Qobuz](https://www.qobuz.com/) and [Spotify](https://www.spotify.com/)
|
||||
* Song lyrics from [STANDS4](https://www.lyrics.com/), [Genius](https://genius.com/), [Musixmatch](https://www.musixmatch.com/), [ChartLyrics](http://www.chartlyrics.com/), [lyrics.ovh](https://lyrics.ovh/) and [lololyrics.com](https://www.lololyrics.com/)
|
||||
* Song lyrics from [Lyrics.com](https://www.lyrics.com/), [Genius](https://genius.com/), [Musixmatch](https://www.musixmatch.com/), [ChartLyrics](http://www.chartlyrics.com/), [lyrics.ovh](https://lyrics.ovh/) and [lololyrics.com](https://www.lololyrics.com/)
|
||||
* Support for multiple backends
|
||||
* Audio analyzer
|
||||
* Audio equalizer
|
||||
|
2
debian/control.in
vendored
2
debian/control.in
vendored
@ -52,7 +52,7 @@ Description: music player and music collection organizer
|
||||
- Edit tags on audio files
|
||||
- Automatically retrieve tags from MusicBrainz
|
||||
- Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify
|
||||
- Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
- Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
- Audio analyzer
|
||||
- Audio equalizer
|
||||
- Transfer music to mass-storage USB players, MTP compatible devices and iPod Nano/Classic
|
||||
|
@ -29,7 +29,7 @@
|
||||
<li>Edit tags on audio files</li>
|
||||
<li>Automatically retrieve tags from MusicBrainz</li>
|
||||
<li>Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify</li>
|
||||
<li>Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com</li>
|
||||
<li>Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com</li>
|
||||
<li>Support for multiple backends</li>
|
||||
<li>Audio analyzer and equalizer</li>
|
||||
<li>Transfer music to mass-storage USB players, MTP compatible devices and iPod Nano/Classic</li>
|
||||
|
2
dist/unix/strawberry.1
vendored
2
dist/unix/strawberry.1
vendored
@ -29,7 +29,7 @@ Features:
|
||||
.br
|
||||
- Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify
|
||||
.br
|
||||
- Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
- Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
.br
|
||||
- Support for multiple backends
|
||||
.br
|
||||
|
2
dist/unix/strawberry.spec.in
vendored
2
dist/unix/strawberry.spec.in
vendored
@ -119,7 +119,7 @@ Features:
|
||||
- Edit tags on audio files
|
||||
- Automatically retrieve tags from MusicBrainz
|
||||
- Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify
|
||||
- Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
- Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
|
||||
- Support for multiple backends
|
||||
- Audio analyzer
|
||||
- Audio equalizer
|
||||
|
@ -179,7 +179,7 @@ set(SOURCES
|
||||
lyrics/geniuslyricsprovider.cpp
|
||||
lyrics/musixmatchlyricsprovider.cpp
|
||||
lyrics/chartlyricsprovider.cpp
|
||||
lyrics/stands4lyricsprovider.cpp
|
||||
lyrics/lyricscomlyricsprovider.cpp
|
||||
|
||||
providers/musixmatchprovider.cpp
|
||||
|
||||
@ -415,7 +415,7 @@ set(HEADERS
|
||||
lyrics/geniuslyricsprovider.h
|
||||
lyrics/musixmatchlyricsprovider.h
|
||||
lyrics/chartlyricsprovider.h
|
||||
lyrics/stands4lyricsprovider.h
|
||||
lyrics/lyricscomlyricsprovider.h
|
||||
|
||||
settings/settingsdialog.h
|
||||
settings/settingspage.h
|
||||
|
@ -62,7 +62,7 @@
|
||||
#include "lyrics/lololyricsprovider.h"
|
||||
#include "lyrics/musixmatchlyricsprovider.h"
|
||||
#include "lyrics/chartlyricsprovider.h"
|
||||
#include "lyrics/stands4lyricsprovider.h"
|
||||
#include "lyrics/lyricscomlyricsprovider.h"
|
||||
|
||||
#include "scrobbler/audioscrobbler.h"
|
||||
#include "scrobbler/lastfmimport.h"
|
||||
@ -153,7 +153,7 @@ class ApplicationImpl {
|
||||
lyrics_providers->AddProvider(new LoloLyricsProvider(lyrics_providers->network(), app));
|
||||
lyrics_providers->AddProvider(new MusixmatchLyricsProvider(lyrics_providers->network(), app));
|
||||
lyrics_providers->AddProvider(new ChartLyricsProvider(lyrics_providers->network(), app));
|
||||
lyrics_providers->AddProvider(new Stands4LyricsProvider(lyrics_providers->network(), app));
|
||||
lyrics_providers->AddProvider(new LyricsComLyricsProvider(lyrics_providers->network(), app));
|
||||
lyrics_providers->ReloadSettings();
|
||||
return lyrics_providers;
|
||||
}),
|
||||
|
@ -37,16 +37,16 @@
|
||||
#include "utilities/strutils.h"
|
||||
#include "lyricssearchrequest.h"
|
||||
#include "lyricssearchresult.h"
|
||||
#include "stands4lyricsprovider.h"
|
||||
#include "lyricscomlyricsprovider.h"
|
||||
|
||||
const char *Stands4LyricsProvider::kApiUrl = "https://www.abbreviations.com/services/v2/lyrics.php";
|
||||
const char *Stands4LyricsProvider::kLyricsUrl = "https://www.lyrics.com/lyrics/";
|
||||
const char *Stands4LyricsProvider::kUID = "11363";
|
||||
const char *Stands4LyricsProvider::kTokenB64 = "b3FOYmxhV1ZKRGxIMnV4OA==";
|
||||
const char *LyricsComLyricsProvider::kApiUrl = "https://www.abbreviations.com/services/v2/lyrics.php";
|
||||
const char *LyricsComLyricsProvider::kLyricsUrl = "https://www.lyrics.com/lyrics/";
|
||||
const char *LyricsComLyricsProvider::kUID = "11363";
|
||||
const char *LyricsComLyricsProvider::kTokenB64 = "b3FOYmxhV1ZKRGxIMnV4OA==";
|
||||
|
||||
Stands4LyricsProvider::Stands4LyricsProvider(NetworkAccessManager *network, QObject *parent) : JsonLyricsProvider("Stands4Lyrics", true, false, network, parent), use_api_(true) {}
|
||||
LyricsComLyricsProvider::LyricsComLyricsProvider(NetworkAccessManager *network, QObject *parent) : JsonLyricsProvider("Lyrics.com", true, false, network, parent), use_api_(true) {}
|
||||
|
||||
Stands4LyricsProvider::~Stands4LyricsProvider() {
|
||||
LyricsComLyricsProvider::~LyricsComLyricsProvider() {
|
||||
|
||||
while (!replies_.isEmpty()) {
|
||||
QNetworkReply *reply = replies_.takeFirst();
|
||||
@ -57,7 +57,7 @@ Stands4LyricsProvider::~Stands4LyricsProvider() {
|
||||
|
||||
}
|
||||
|
||||
bool Stands4LyricsProvider::StartSearch(const int id, const LyricsSearchRequest &request) {
|
||||
bool LyricsComLyricsProvider::StartSearch(const int id, const LyricsSearchRequest &request) {
|
||||
|
||||
if (use_api_) {
|
||||
SendSearchRequest(id, request);
|
||||
@ -70,7 +70,7 @@ bool Stands4LyricsProvider::StartSearch(const int id, const LyricsSearchRequest
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::SendSearchRequest(const int id, const LyricsSearchRequest &request) {
|
||||
void LyricsComLyricsProvider::SendSearchRequest(const int id, const LyricsSearchRequest &request) {
|
||||
|
||||
QUrlQuery url_query;
|
||||
url_query.addQueryItem(QUrl::toPercentEncoding("uid"), QUrl::toPercentEncoding(kUID));
|
||||
@ -89,9 +89,9 @@ void Stands4LyricsProvider::SendSearchRequest(const int id, const LyricsSearchRe
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::CancelSearch(const int id) { Q_UNUSED(id); }
|
||||
void LyricsComLyricsProvider::CancelSearch(const int id) { Q_UNUSED(id); }
|
||||
|
||||
void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request) {
|
||||
void LyricsComLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request) {
|
||||
|
||||
if (!replies_.contains(reply)) return;
|
||||
replies_.removeAll(reply);
|
||||
@ -108,54 +108,54 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id
|
||||
QJsonDocument json_doc = QJsonDocument::fromJson(data, &json_error);
|
||||
|
||||
if (json_error.error != QJsonParseError::NoError) {
|
||||
qLog(Error) << "Stands4Lyrics: Failed to parse json data" << json_error.errorString();
|
||||
qLog(Error) << "Lyrics.com: Failed to parse json data" << json_error.errorString();
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (json_doc.isEmpty()) {
|
||||
qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_doc.isObject()) {
|
||||
qLog(Error) << "Stands4Lyrics: Json document is not an object.";
|
||||
qLog(Error) << "Lyrics.com: Json document is not an object.";
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonObject json_obj = json_doc.object();
|
||||
if (json_obj.isEmpty()) {
|
||||
qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (json_obj.contains("error")) {
|
||||
const QString error = json_obj["error"].toString();
|
||||
qLog(Error) << "Stands4Lyrics: Received error:" << error << "switching to URL based lookup.";
|
||||
qLog(Error) << "Lyrics.com: Received error:" << error << "switching to URL based lookup.";
|
||||
use_api_ = false;
|
||||
CreateLyricsRequest(id, request);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_obj.contains("result") || !json_obj["result"].isArray()) {
|
||||
qLog(Error) << "Stands4Lyrics: Json reply is missing result.";
|
||||
qLog(Error) << "Lyrics.com: Json reply is missing result.";
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonArray json_result = json_obj["result"].toArray();
|
||||
if (json_result.isEmpty()) {
|
||||
qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const QJsonValueRef value : json_result) {
|
||||
if (!value.isObject()) {
|
||||
qLog(Error) << "Stands4Lyrics: Invalid Json reply, result is not an object.";
|
||||
qLog(Error) << "Lyrics.com: Invalid Json reply, result is not an object.";
|
||||
continue;
|
||||
}
|
||||
QJsonObject obj = value.toObject();
|
||||
@ -165,7 +165,7 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id
|
||||
!obj.contains("album") ||
|
||||
!obj.contains("song-link")
|
||||
) {
|
||||
qLog(Error) << "Stands4Lyrics: Invalid Json reply, result is missing data.";
|
||||
qLog(Error) << "Lyrics.com: Invalid Json reply, result is missing data.";
|
||||
qLog(Debug) << value;
|
||||
continue;
|
||||
}
|
||||
@ -198,18 +198,18 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id
|
||||
|
||||
}
|
||||
|
||||
qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::CreateLyricsRequest(const int id, const LyricsSearchRequest &request) {
|
||||
void LyricsComLyricsProvider::CreateLyricsRequest(const int id, const LyricsSearchRequest &request) {
|
||||
|
||||
SendLyricsRequest(id, request, request.artist, request.album, request.title);
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title, QUrl url) {
|
||||
void LyricsComLyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title, QUrl url) {
|
||||
|
||||
if (url.isEmpty() || !url.isValid()) {
|
||||
url.setUrl(kLyricsUrl + StringFixup(result_artist) + "/" + StringFixup(result_title) + ".html");
|
||||
@ -223,7 +223,7 @@ void Stands4LyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRe
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title) {
|
||||
void LyricsComLyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title) {
|
||||
|
||||
if (!replies_.contains(reply)) return;
|
||||
replies_.removeAll(reply);
|
||||
@ -243,19 +243,19 @@ void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id
|
||||
|
||||
const QByteArray data = reply->readAll();
|
||||
if (data.isEmpty()) {
|
||||
qLog(Error) << "Stands4Lyrics: Empty reply received from server.";
|
||||
qLog(Error) << "Lyrics.com: Empty reply received from server.";
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
const QString lyrics = ParseLyricsFromHTML(QString::fromUtf8(data), QRegularExpression("<div[^>]*>"), QRegularExpression("<\\/div>"), QRegularExpression("<div id=\"lyrics\"[^>]+>"), false);
|
||||
if (lyrics.isEmpty() || lyrics.contains("Click to search for the Lyrics on Lyrics.com", Qt::CaseInsensitive)) {
|
||||
qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
qLog(Debug) << "Stands4Lyrics: Got lyrics for" << request.artist << request.album << request.title;
|
||||
qLog(Debug) << "Lyrics.com: Got lyrics for" << request.artist << request.album << request.title;
|
||||
|
||||
LyricsSearchResult result(lyrics);
|
||||
result.artist = result_artist;
|
||||
@ -265,7 +265,7 @@ void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id
|
||||
|
||||
}
|
||||
|
||||
QString Stands4LyricsProvider::StringFixup(QString string) {
|
||||
QString LyricsComLyricsProvider::StringFixup(QString string) {
|
||||
|
||||
return string.replace('/', '-')
|
||||
.replace('\'', '-')
|
||||
@ -277,9 +277,9 @@ QString Stands4LyricsProvider::StringFixup(QString string) {
|
||||
|
||||
}
|
||||
|
||||
void Stands4LyricsProvider::Error(const QString &error, const QVariant &debug) {
|
||||
void LyricsComLyricsProvider::Error(const QString &error, const QVariant &debug) {
|
||||
|
||||
qLog(Error) << "Stands4Lyrics:" << error;
|
||||
qLog(Error) << "Lyrics.com:" << error;
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
}
|
@ -17,8 +17,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef STANDS4LYRICSPROVIDER_H
|
||||
#define STANDS4LYRICSPROVIDER_H
|
||||
#ifndef LYRICSCOMLYRICSPROVIDER_H
|
||||
#define LYRICSCOMLYRICSPROVIDER_H
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QObject>
|
||||
@ -33,12 +33,12 @@
|
||||
class QNetworkReply;
|
||||
class NetworkAccessManager;
|
||||
|
||||
class Stands4LyricsProvider : public JsonLyricsProvider {
|
||||
class LyricsComLyricsProvider : public JsonLyricsProvider {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Stands4LyricsProvider(NetworkAccessManager *network, QObject *parent = nullptr);
|
||||
~Stands4LyricsProvider() override;
|
||||
explicit LyricsComLyricsProvider(NetworkAccessManager *network, QObject *parent = nullptr);
|
||||
~LyricsComLyricsProvider() override;
|
||||
|
||||
bool StartSearch(const int id, const LyricsSearchRequest &request) override;
|
||||
void CancelSearch(const int id) override;
|
||||
@ -63,4 +63,4 @@ class Stands4LyricsProvider : public JsonLyricsProvider {
|
||||
bool use_api_;
|
||||
};
|
||||
|
||||
#endif // STANDS4LYRICSPROVIDER_H
|
||||
#endif // LYRICSCOMLYRICSPROVIDER_H
|
Loading…
x
Reference in New Issue
Block a user