2
0
mirror of https://github.com/WikiTeam/wikiteam synced 2024-11-04 12:00:28 +00:00

wikimedia commons downloader

git-svn-id: https://wikiteam.googlecode.com/svn/trunk@334 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
This commit is contained in:
emijrp 2012-02-27 18:18:57 +00:00
parent 6c3f888eb0
commit a16a121fbc

View File

@ -40,7 +40,7 @@ print "Downloading Wikimedia Commons images from %s to %s" % (startdate.strftime
while startdate <= enddate:
print '==', startdate.strftime('%Y-%m-%d'), '=='
path = startdate.strftime('%Y/%m/%d')
filename7z = startdate.strftime('%Y-%m-%d.7z')
filenamezip = startdate.strftime('%Y-%m-%d.zip')
try:
os.makedirs(path)
except:
@ -66,6 +66,6 @@ while startdate <= enddate:
os.system('curl -d "&pages=File:%s&history=1&action=submit" http://commons.wikimedia.org/w/index.php?title=Special:Export -o "%s/%s.desc"' % (original_name_, path, img_name_))
c += 1
#7z
os.system('7z a %s %s' % (filename7z, path))
os.system('zip -9 %s %s/*' % (filenamezip, path))
startdate += delta