If I remember correctly it can be done wihtout much scripting. Take as an
example
http://commons.wikimedia.org/wiki/File:Panor%C3%A0mica_del_Monestir_de_Sant_Cugat.jpg.
You can get 1000px versions or whatever with the URL
http://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Panor%C3%A0mica_del_Monestir_de_Sant_Cugat.jpg/1024px-Panor%C3%A0mica_del_Monestir_de_Sant_Cugat.jpg
.

The URL is generated like this:

http://upload.wikimedia.org/wikipedia/commons/thumb/ + md5(filename)[0] + /
+ md5(filename)[:2] + / + filename + / + width + - + filename

I believe it's that way; Maarten correct me if I'm wrong. You say you
already have a text list. In the case they are only filenames, this python
program would do the job (pretty dirty code):

# -*- coding: utf-8 -*-

import md5, sys

with open("proves.txt") as f:
  l = f.read().split("\n")

l.remove('')

for x in l:
  x = x.replace(" ","_")
  m = md5.new()
  m.update(x)
  y = m.hexdigest()
  s = "http://upload.wikimedia.org/wikipedia/commons/thumb/
"+y[0]+"/"+y[:2]+"/"+x+"/1000px-"+x
  print s

Change proves.txt by the file where you have the list. In case it has URLs,
some modifications are needed. In can also be modified to save everything to
a file, just by adding the line 'sys.stdout = file("output.txt","a")' right
before 'with open...'.


Joan Creus.

2011/10/10 Kilian Kluge <[email protected]>

> I fear that I'm not able to do this. My script is working from an
> API-request DerHexer created for me, so it will work from with text file
> with a list of urls in it. If someone can create a list of 1000px-versions,
> it's no problem to use it.
>
>
> On Mon, Oct 10, 2011 at 11:41 AM, Lodewijk <[email protected]>wrote:
>
>> It would indeed be nice to have a adapt the script to download 1000px
>> versions :)
>>
>> Lodewijk
>>
>> No dia 10 de Outubro de 2011 11:29, Kilian Kluge <[email protected]>escreveu:
>>
>> Well, I guess that the main problem is the jurors internet connection. I
>>> have "VDSL" (50 000) which is the fastest you can get on the free market
>>> here in Germany and it took me about 24 hours to download all the German
>>> images...
>>>
>>>
>>> On Mon, Oct 10, 2011 at 11:10 AM, Maarten Dammers 
>>> <[email protected]>wrote:
>>>
>>>> Of course I read that! I'm just looking for something more scalable and
>>>> noob proof ;-)
>>>>
>>>> Maarten
>>>>
>>>> Op 9 okt 2011 om 23:40 heeft Kilian Kluge <[email protected]> het
>>>> volgende geschreven:\
>>>>
>>>> Hi Maarten,
>>>>
>>>> have a look at the thread "Getting the pictures to the jury: The German
>>>> approach"
>>>>
>>>> Kilian
>>>>
>>>> On Sun, Oct 9, 2011 at 10:13 PM, Maarten Dammers <<[email protected]>
>>>> [email protected]> wrote:
>>>>
>>>>> Hi everyone,
>>>>>
>>>>> Some of our jury members would like to download images. Last year I
>>>>> made
>>>>> <https://fisheye.toolserver.org/browse/multichill/bot/erfgoed/download_WLM.py?hb=true>
>>>>> https://fisheye.toolserver.org/browse/multichill/bot/erfgoed/download_WLM.py?hb=true
>>>>> . It's a simple pywikipedia based downloader. Easy for me, but not
>>>>> really for a (non-technical) jury member. Any suggestions what to give
>>>>> them?
>>>>> I was thinking about compiling a list of all images, either originals
>>>>> or
>>>>> thumbs depending on the size, as list of urls which people could feed
>>>>> to
>>>>> a tool like wget. Any easier suggestions?
>>>>>
>>>>> Maarten
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Wiki Loves Monuments mailing list
>>>>>  <[email protected]>
>>>>> [email protected]
>>>>>  <https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments>
>>>>> https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
>>>>>  <http://www.wikilovesmonuments.eu>http://www.wikilovesmonuments.eu
>>>>>
>>>>
>>>> _______________________________________________
>>>> Wiki Loves Monuments mailing list
>>>> [email protected]
>>>> https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
>>>> http://www.wikilovesmonuments.eu
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Wiki Loves Monuments mailing list
>>> [email protected]
>>> https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
>>> http://www.wikilovesmonuments.eu
>>>
>>
>>
>
> _______________________________________________
> Wiki Loves Monuments mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
> http://www.wikilovesmonuments.eu
>
_______________________________________________
Wiki Loves Monuments mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
http://www.wikilovesmonuments.eu

Reply via email to