From fd5d3d0a48a44c334b11f96c2166e295cfca95b7 Mon Sep 17 00:00:00 2001 From: Josep Sayol Date: Fri, 11 Sep 2015 13:41:49 +0700 Subject: [PATCH] Allow adding torrent link from Torcache Recent changes in Torcache prevent adding (or drag-and-dropping) a torrent link into qBittorrent. Modifying DownloadManager to always spoof the HTTP Referer header to the file itself being downloaded solves this. --- src/core/net/downloadmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/net/downloadmanager.cpp b/src/core/net/downloadmanager.cpp index 7aed502c7..b048877b5 100644 --- a/src/core/net/downloadmanager.cpp +++ b/src/core/net/downloadmanager.cpp @@ -88,6 +88,9 @@ DownloadHandler *DownloadManager::downloadUrl(const QString &url, bool saveToFil // Spoof Firefox 38 user agent to avoid web server banning request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Firefox/38.0"); + // Spoof HTTP Referer to allow adding torrent link from Torcache/KickAssTorrents + request.setRawHeader("Referer", request.url().toEncoded().data()); + qDebug("Downloading %s...", request.url().toEncoded().data()); // accept gzip request.setRawHeader("Accept-Encoding", "gzip");