mirror of
https://github.com/linbailo/zyqinglong.git
synced 2026-01-12 19:30:42 +08:00
明天论坛修复一些小问题
This commit is contained in:
parent
900f7d42db
commit
ef8c3a047f
12
mt.py
12
mt.py
@ -78,15 +78,18 @@ def send_notification_message(title):
|
|||||||
|
|
||||||
def main(username,password):
|
def main(username,password):
|
||||||
headers={'User-Agent': ua}
|
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)
|
session.get('https://bbs.binmt.cc',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)
|
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]
|
try:
|
||||||
formhash = re.findall('formhash" value="(.*?)".*? />', chusihua.text)[0]
|
loginhash = re.findall('loginhash=(.*?)">', chusihua.text)[0]
|
||||||
|
formhash = re.findall('formhash" value="(.*?)".*? />', chusihua.text)[0]
|
||||||
|
except Exception as e:
|
||||||
|
print('loginhash、formhash获取失败')
|
||||||
denurl = f'https://bbs.binmt.cc/member.php?mod=logging&action=login&loginsubmit=yes&handlekey=login&loginhash={loginhash}&inajax=1'
|
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': '',}
|
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
|
denlu = session.post(headers=headers, url=denurl, data=data).text
|
||||||
#print(denlu)
|
|
||||||
if '欢迎您回来' in denlu:
|
if '欢迎您回来' in denlu:
|
||||||
#获取分组、名字
|
#获取分组、名字
|
||||||
fzmz = re.findall('欢迎您回来,(.*?),现在', denlu)[0]
|
fzmz = re.findall('欢迎您回来,(.*?),现在', denlu)[0]
|
||||||
@ -103,6 +106,7 @@ def main(username,password):
|
|||||||
huoqu(formhash)
|
huoqu(formhash)
|
||||||
else:
|
else:
|
||||||
myprint('登录失败')
|
myprint('登录失败')
|
||||||
|
print(re.findall("CDATA(.*?)<", denlu)[0])
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user