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

md5 function

git-svn-id: https://wikiteam.googlecode.com/svn/trunk@347 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
This commit is contained in:
emijrp 2012-02-28 15:59:17 +00:00
parent b7767538e7
commit 5235dc1896

View File

@ -128,7 +128,7 @@ def main():
#ok, restore original_name to ! version and recalculate md5 and other variables that use original_name as source
original_name = img_name
original_name_ = re.sub(r'"', r'\"', re.sub(r' ', r'_', original_name.encode('utf-8')))
md5hash = md5.new(re.sub(' ', '_', original_name.encode("utf-8"))).hexdigest()
md5hash = md5(re.sub(' ', '_', original_name.encode("utf-8"))).hexdigest()
#redownload, now without /archive/ subpath
os.system('wget -c "http://upload.wikimedia.org/wikipedia/commons/%s/%s/%s" -O "%s/%s"' % (md5hash[0], md5hash[0:2], img_name_quoted, savepath, img_saved_as_))
else: