jumpjack Posted February 4, 2010 Share Posted February 4, 2010 I am not able to download images from this address using Curl: http://www.sat24.com/image.ashx?sat=vis&type=history&country=it&time=201002021000&sessionid=lu5gewaraqfnw0igmbcb5tuh Note: that url CANNOT work for you until you'll obtain a new session id: use this page to select the image to download, and drag the image to address bar to read the session id: http://www.sat24.com/history.aspx?country=it I think the server "knows" the request is coming from a server rather than from clicking on a link. But a link to such an image CAN be inserted into a web page to hot-link the image. Question is: can I configure Curl request in such a way it looks like an hotlinking? Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/ Share on other sites More sharing options...
jumpjack Posted February 5, 2010 Author Share Posted February 5, 2010 No clues? found other interesting URLs to decode: http://www2.sat24.com/homepage.aspx?html=zoom&xas=360&yas=340 (note the www2) http://www2.sat24.com/mysat/1480-1460-METE_RGB-12-12-1_europa1500m-ano_1002051030.gif http://www.sat24.com/maptravelertijd.js http://www2.sat24.com/HomepageAnim.aspx?country=it&sat=vis&type=slide (click & zoom & pan) http://www2.sat24.com/image.ashx?country=eu&type=slide&index=1&sat Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/#findComment-1007403 Share on other sites More sharing options...
jumpjack Posted February 7, 2010 Author Share Posted February 7, 2010 up...? Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/#findComment-1008386 Share on other sites More sharing options...
teamatomic Posted February 7, 2010 Share Posted February 7, 2010 You dont show any code s we dont really know what you are doing. But to pretend you are "hotlinking" set a user-agaent to look like a browser to the connect to server. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux 2.6.32-7 i586; en-US; m18) Gecko/20010131 Netscape6/6.01 '); otherwise if you set nothing and dont id yourself you look like a bad bot. HTH Teamaotmic Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/#findComment-1008473 Share on other sites More sharing options...
jumpjack Posted February 7, 2010 Author Share Posted February 7, 2010 You dont show any code s we dont really know what you are doing. But to pretend you are "hotlinking" set a user-agaent to look like a browser to the connect to server. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux 2.6.32-7 i586; en-US; m18) Gecko/20010131 Netscape6/6.01 '); otherwise if you set nothing and dont id yourself you look like a bad bot. HTH Teamaotmic This is my code. $ch = curl_init(); $fp = fopen($nomefile, "w"); curl_setopt($ch, CURLOPT_URL, $DATA_PATH); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, 'http://www2.sat24.com/'); curl_setopt($ch, CURLOPT_FILE, $fp); $immagine = curl_exec($ch); curl_close($ch); fclose($fp); Gonna trying your tips. Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/#findComment-1008485 Share on other sites More sharing options...
jumpjack Posted February 11, 2010 Author Share Posted February 11, 2010 it does not work. any more suggestion? All I can do right now is just createing a page containing all links to images I want to download: they are properly displayed, so when I save the full web page, they get saved properly ... but they are all mixed up rather than in viewing order, and they have random names!!! :'( Link to comment https://forums.phpfreaks.com/topic/190899-problem-downloading-image-with-curl/#findComment-1010617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.