diff --git a/mt.py b/mt.py index a5f7f9f..e2297a8 100644 --- a/mt.py +++ b/mt.py @@ -26,13 +26,13 @@ def main(username,password): headers={'User-Agent': ua} session.get('https://bbs.binmt.cc/member.php?mod=logging&action=login&infloat=yes&handlekey=login&inajax=1&ajaxtarget=fwin_content_login',headers=headers) chusihua = session.get('https://bbs.binmt.cc/member.php?mod=logging&action=login&infloat=yes&handlekey=login&inajax=1&ajaxtarget=fwin_content_login',headers=headers) - print(re.findall('loginhash=(.*?)">', chusihua.text)) + #print(re.findall('loginhash=(.*?)">', chusihua.text)) loginhash = re.findall('loginhash=(.*?)">', chusihua.text)[0] formhash = re.findall('formhash" value="(.*?)".*? />', chusihua.text)[0] denurl = f'https://bbs.binmt.cc/member.php?mod=logging&action=login&loginsubmit=yes&handlekey=login&loginhash={loginhash}&inajax=1' data = {'formhash': formhash,'referer': 'https://bbs.binmt.cc/forum.php','loginfield': 'username','username': username,'password': password,'questionid': '0','answer': '',} denlu = session.post(headers=headers, url=denurl, data=data).text - print(denlu) + #print(denlu) if '欢迎您回来' in denlu: #获取分组、名字 fzmz = re.findall('欢迎您回来,(.*?),现在', denlu)[0]