I'm trying to download a file from a website that requires login. This command retrieves the cookie.txt and the downloaded html shows I'm logged in (ok):
(I broke the command in lines for readability)
wget
--user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0)
Gecko/20100101 Firefox/45.0"
--keep-session-cookies
--save-cookies cookies.txt
--post-data "login_useame=MyUserName&login_password=*******"
--header="Host: somewebsite.com"
--header="Referer: http://somewebsite.com/files/dl.php?t=2157716"
http://somewebsite.com/login.php
Here I get cookies.txt. (all ok). And after that: (trying to download)
wget
--user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0)
Gecko/20100101 Firefox/45.0"
--load-cookies cookies.txt
--header="Host: somewebsite.com"
--header="Referer: http://somewebsite.com/files/dl.php?t=2157716"
--header="Coection: keep-alive" --header="Accept-Language: en-US,en;q=0.5"
--header="Accept-Encoding: gzip, deflate"
http://somewebsite.com/files/dl.php?t=2157716
But instead of downloading the file it retus an HTML saying that the file can only be downloaded from the website.
Here is the POST data from Firefox right before the download starts:
What is missing?
برچسب:
نویسنده: استخدام کار