pythonchallenge Level 29

第29关地址:http://www.pythonchallenge.com/pc/ring/guido.html

用户名 repeat 密码 switch

查看源码

标题:silence!

图片名称:whoisit.jpg

import base64
import bz2
import requests

url = "http://www.pythonchallenge.com/pc/ring/guido.html"
Authorization = format(base64.b64encode(b'repeat:switch').decode())
headers = {'Authorization': 'Basic %s' % Authorization}
response = requests.request("GET", url, headers=headers)
# print(response.text) # 发现下面有很多空行
blank = response.text.splitlines()[12:]
lenblank = [len(b) for b in blank] # 计算每行空格个数
print(lenblank)
text = bz2.decompress(bytes(lenblank)).decode() 
print(text)  # Isn't it clear? I am yankeedoodle!

得到 Isn't it clear? I am yankeedoodle!

图片名称是 who is it 答案 yankeedoodle

获得下一关地址:http://www.pythonchallenge.com/pc/ring/yankeedoodle.html

posted @ 2021-12-07 10:05  OTAKU_nicole  阅读(56)  评论(0编辑  收藏  举报