Is it possible to download files from from file hosting sites using QNetworkAccessManager
-
I tried my level best to download a file from uploading.com but all in vain. I tried every possible way of redirection, but all in vain. It always ends up with error Moved Permanently and if you try redirections it ends up downloading the web page.
-
Actually, that thread discusses an issue related to cookies. But this time it is not related to cookies. I tried downloading without a premium account using regular download option and it failed every time. On the other hand, the inbuilt download manager of firefox doesn't seem to have any problem.
-
Actually, the problem is with non-premium accounts. They only allow one download at a time. When we try to download using QNetworkAccessManager, it makes a get request on the url, which was already used by firefox, file hosting sites disallow this and redirect all further requests to their webpage. So, redirection causes the page to be downloaded instead of file. Obviously, this problem is with non-premium accounts only.
Besides, is there any advantage of using redirection feature of QNetworkAccessManager to fetch the new url over using the following method:
@if(statusCode==307||dSegment[0].replySegment->rawHeaderList().contains("Location"))
{
downUrl=reply->header(QNetworkRequest::LocationHeader).toString();
} @ -
Does their website use JavaScript redirection? If I'm not mistaken, QNetworkAccessManager can't handle those.
-
What redirection mechanism in QNetworkAccessManager? The QNetworkReply it gives you represents what the server sends. Neither class follows redirections or sends a new request.
Web browsers follow redirections and execute Javascript by default, which is why Firefox works.
I fail to see what all the other talk bemoaning the service's anti-leaching/revenue protection measures has to do with Qt.