Add COMIC_VINE_USER_AGENT to YACReaderLibrary.ini to be able to customize the user agent

This commit is contained in:
luisangelsm
2025-12-10 10:42:45 +01:00
parent 620140cf12
commit 79eb19a192
10 changed files with 44 additions and 20 deletions

View File

@ -12,8 +12,8 @@
#define PREVIOUS_VERSION "6.0.0"
HttpWorker::HttpWorker(const QString &urlString)
: QThread(), url(urlString), _error(false), _timeout(false)
HttpWorker::HttpWorker(const QString &urlString, const QString &userAgent)
: QThread(), url(urlString), userAgent(userAgent), _error(false), _timeout(false)
{
}
@ -50,7 +50,7 @@ void HttpWorker::run()
auto request = QNetworkRequest(url);
request.setHeader(QNetworkRequest::UserAgentHeader,
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/122.0 Safari/537.36");
userAgent);
QNetworkReply *reply = manager.get(request);