Browse Source

- HTTP downloader now uses Firefox User Agent to make sure it is allowed

- HTTP downloader now supports already encoded URLs
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
4af05dc63c
  1. 8
      src/downloadthread.cpp

8
src/downloadthread.cpp

@ -84,7 +84,13 @@ void downloadThread::downloadUrl(QString url){
// Update proxy settings // Update proxy settings
applyProxySettings(); applyProxySettings();
// Process download request // 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() { void downloadThread::applyProxySettings() {

Loading…
Cancel
Save