Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
wget downloads corrupt JPEG file

I'm trying to do a script so I can set this image as background and update it each 10 minutes, but I can not even download the image:

$ wget "http://static.die.net/earth/mercator/1600.jpg" -O imagen.jpg


--2012-08-23 17:51:41--  http://static.die.net/earth/mercator/1600.jpg
Solving static.die.net (static.die.net)... 209.151.236.22, 2607:f820:42::16
Connecting with static.die.net (static.die.net)[209.151.236.22]:80... connected.
HTTP Request sent, waiting reply... 200 OK
Length: 37 [image/gif]
Saving to: “imagen.jpg”

100%[======================================>] 37          --.-K/s   en 0s      

2012-08-23 17:51:42 (5,58 MB/s) - “imagen.jpg” saved [37/37]

And "imagen.jpg"'s size is 37 bytes...

Any idea?

PD: Output of wget was in Spansih, so I translated into English.

share|improve this question
1  
The answer is probably here askubuntu.com/questions/24935/… –  user76204 Aug 23 '12 at 16:05
add comment

marked as duplicate by jokerdino, Jacob Johan Edwards, John S Gruber, Mitch, con-f-use Aug 25 '12 at 8:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 1 down vote accepted

It looks like it's silently redirecting you to a gif image which just happens to be empty. This is a simple tactic that CDNs use to stop people scraping with tools like wget.

Unfortunately (for them) wget allows you to spoof another user agent string like so:

wget -U 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1' http://static.die.net/earth/mercator/1600.jpg

But you should probably interpret their empty image response as a "please don't use wget on our servers". It's probably in their terms of service.

share|improve this answer
    
Good to know, it seems useful. –  lilEzek Aug 23 '12 at 17:58
add comment

This image comes as a feature to the Wallch program as well. As mentioned here: http://wall-changer.sourceforge.net/screenshots.php Wallch uses a third-party image hoster so as to provide this image, for protection of static.die.net's bandwidth.

So, if you want this image as your background you can go and download Wallch (it is at the Ubuntu Software Center).

By the way, the image is updated every 30 minutes, not every 10.

share|improve this answer
    
Thank you very much. This is what I was looking for. –  lilEzek Aug 23 '12 at 18:00
    
If this is the correct answer, then please mark this answer as accepted, not the other one. Thanks. –  hakermania Aug 23 '12 at 18:03
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.