from bs4 import BeautifulSoup #用于解析源代码
import requests #用于向服务器发送请求
url = "https://www.splitbrain.org/_static/ook/index.php"
print('*********************************************************')
print('* *')
print('* 自动解ook和Brainfuck解码 *')
print('* *')
print('* *')
print('* *')
print('* *')
print('* *')
print('*********************************************************')
text=input('输入需要解码的数据:')
Ook=0
Brainfuck=0
OB=0
for i in range(100):
flag=1
if flag==1:
ook=text
data = {
"input": text,
"do": "Ook! to Text"
}
response = requests.post(url, data=data).text
soup=BeautifulSoup(response,'lxml') #初始化
text=soup.textarea.text
if text=='':
flag=0
text=ook
else:
Ook+=1
OB+=1
if flag==0:
data={
"input": text,
"do": "Brainfuck to Text"
}
response = requests.post(url, data=data).text
soup=BeautifulSoup(response,'lxml') #初始化
text=soup.textarea.text
if text not in '':
Brainfuck+=1
OB+=1
if ('ook' not in text) and ('+' not in text) and ('.' not in text):
break
print(f'ook解码了{Ook}次,Brainfuck解码了{Brainfuck}次,共计{OB}')
print(f'解出的结果是{text}')
06-30
3810
11-04
9447
11-13
05-19
556