from requests import get
import shutil

strink = "https://web.archive.org/web/20121022124639/http://mylittlefacewhen.com/f/%s"

def savefile(url):
	response = get(url, stream=True)
	with open(url.split("/")[-1], 'wb') as out_file:
		shutil.copyfileobj(response.raw, out_file)
	del response

for i in xrange(1,6280):
	response = get(strink % i)

	print i
	
	gyg = response.text.split(" ")
	
	for j in gyg:
		if "media/f/img/mlfw%s_" %i in j and "original" in j:
			print j[j.find("https://"):-15]
	
			try:
				meh = j[j.find("https://"):-15]
				if meh[-1] == '"':
					meh = meh[:-1]
				savefile(meh)
	
			except:
				print "file not found even in the archive,sorry"