Reputation: 133
i have this link
i paste it into my browser then got an image. but when i'm coding to download this, i got some HTML code, here it is:
<html><head><title>Redirection</title></head><body><script type="text/javascript">window.location.href="http:\/\/phsueh.deviantart.com\/art\/DOTA2-Wraith-Night-425078223"</script><noscript><a href="http://phsueh.deviantart.com/art/DOTA2-Wraith-Night-425078223">Click here to continue.</a></noscript></body></html>
can anyone tell me how to get actual image that the link point to.
p/s: i follow this tutorial http://www.java2s.com/Code/Cpp/Qt/DownloadfromURL.htm
Upvotes: 1
Views: 149
Reputation: 5587
You need to request the art page first to save the cookie userinfo
and get the individual download link (containing token and timestamp) the page gave you. It could be found with a string search for the download button element and extracting the href
value.
<a class="dev-page-button dev-page-button-with-text dev-page-download"
Now you just have to send a request for that individual download link with the saved cookie and you will be redirected to your image.
Upvotes: 3