3

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 cannot 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?

NB: Output of wget was in Spanish, so I translated into English.

1

2 Answers 2

3

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.

0
1

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.

1
  • Good to know, it seems useful.
    – lilEzek
    Aug 23, 2012 at 17:58

Not the answer you're looking for? Browse other questions tagged .