mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 06:17:58 +00:00
- HTTP downloader now uses Firefox User Agent to make sure it is allowed
- HTTP downloader now supports already encoded URLs
This commit is contained in:
parent
ac92287b43
commit
4af05dc63c
@ -84,7 +84,13 @@ void downloadThread::downloadUrl(QString url){
|
||||
// Update proxy settings
|
||||
applyProxySettings();
|
||||
// Process download request
|
||||
networkManager->get(QNetworkRequest(QUrl(url)));
|
||||
QNetworkRequest request;
|
||||
request.setUrl(QUrl::fromEncoded(url.toLocal8Bit()));
|
||||
// Spoof Firefox 3.5 user agent to avoid
|
||||
// Web server banning
|
||||
request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5");
|
||||
qDebug("Downloading %s...", request.url().toString().toLocal8Bit().data());
|
||||
networkManager->get(request);
|
||||
}
|
||||
|
||||
void downloadThread::applyProxySettings() {
|
||||
|
Loading…
Reference in New Issue
Block a user