这一关没有头绪,参考了别人的线索才整出来了……
import urllib,re
url = 'http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg'
#start = 30203
#start = 2123456743
start = 1152983631
end = 2123456789
find = re.compile(r'bytes \d*-(\d*)')
while start<end:
opener = urllib.FancyURLopener()
opener.addheader('Range','bytes=%d-%d' % (start,end))
f = opener.open(url)
start = re.findall(find,str(f.info()))
if len(start)>0:
start = int(start[0])+1
#print f.info()
open(r'F:\Python challenge\out20.zip','wb').write(f.read());break
从30203开始,显示为:
Why don't you respect my privacy?
we can go on in this way for really long time.
stop this!
invader! invader!
ok, invader. you are inside now.
从2123456743开始,显示为:
and it is hiding at 1152983631.
esrever ni emankcin wen ruoy si drowssap eht
最后从1152983631开始,可以下载一段文件,解压密码就是invader颠倒过来:redavni
打开压缩包就过关了。