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.

commands:

mkdir -p sun-yat-sen && wget --directory-prefix=sun-yat-sen -r  -nd -np -A.jpg -erobots=off http://en.wikipedia.org/wiki/Sun_Yat-sen_University

There are several pics on the link: http://en.wikipedia.org/wiki/Sun_Yat-sen_University, after the download process,what i get is all those junk jpg files which could not open by my gnome imgae viewer.

so,what is the reason ?
thanks in advance

share|improve this question
    
What happens if you run file foo.jpg on one of the downloaded files in a terminal? If it says it's html, James's answer is very likely correct. –  poolie Apr 18 '11 at 9:31

1 Answer 1

Wikipedia has information pages about each image it hosts with the name of that image (e.g. http://en.wikipedia.org/wiki/File:North_Square_of_SYSU.jpg). It is probably these pages that you are downloading, when what you really want is the corresponding image (which would be http://upload.wikimedia.org/wikipedia/commons/4/44/North_Square_of_SYSU.jpg for the previous example).

share|improve this answer
    
thanks for the reply. And do i have to download those manually ? –  Tracy Apr 18 '11 at 16:59
    
I don't know of an automated way to get the full size images associated with the article. There are a few libraries that can help you interact with Wikipedia that might help, but I don't know of a ready-made solution. –  James Henstridge Apr 19 '11 at 3:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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