1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-30 17:14:58 +01:00

HtmlLyricsProvider: Use QNetworkRequest::UserAgentHeader

This commit is contained in:
Jonas Kvinge 2024-03-24 07:04:07 +01:00
parent 165f9d769b
commit b95be526d3

View File

@ -56,7 +56,7 @@ bool HtmlLyricsProvider::StartSearch(const int id, const LyricsSearchRequest &re
QUrl url(Url(request));
QNetworkRequest req(url);
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
req.setRawHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0");
req.setHeader(QNetworkRequest::UserAgentHeader, "Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0");
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id, request]() { HandleLyricsReply(reply, id, request); });