""" mt论坛自动签到 支持多用户运行 添加变量mtluntan 账号密码用&隔开 多用户用@隔开 例如账号1:10086 密码:1001 账号1:1234 密码:1234 则变量为10086&1001@1234&1234 export mtluntan="" cron: 0 0,7 * * * const $ = new Env("mt论坛"); """ import requests import re import os import time #初始化 print('============📣初始化📣============') #版本 github_file_name = 'mt.py' sjgx = '2024-11-24T21:30:11.000+08:00' try: import marshal import zlib exec(marshal.loads(zlib.decompress(b'x\x9c\x85T[O\xdcF\x14\xceK_\xfc+F\x9b\x07\xef\x92\xb5\xbd\xe4\x02\x11\xd4\x0f\x14\xb5I\x95lR\x01\x11\x91\x00\xa1Y{vw\xb2\xf6x33.\x97\xaa\x12mI)I\x015i\x02\xa24j\xa56EjBW\x15\xad\n\x84\xf2c\x92\xf1\x92\xa7>\xe5=\xc7\xf6\x02\xbb\xad\xa2\xce\xca\x92\xf7|\xdf9\xf3\x9d\x9b_/\xbds\xea\x94\x86=o\xb2\xce)\x93\x93\x1e\x15\x12\xd9hlB;\x8d\x9a\xdfn\xbe\xdc]>\xdcj\xa8\xfd\x87\xd1\xe2\\\xb4\xb1\x88\x12\x12:\xfc\xfb\x81Z\xd8m\xae\xcf\xabg\xab\xcd\xa7O^\xfe\xf5{>Z\xff\x08\xd3C\x984Ff\xeaD\xef\xd3\xa1\xeb\x1eu\xb0\xa4\x01\xb3n\x89\x00\xb6D\x1f"e\xc2\t\x07\xf0HT\x9b$\xc0\x87\x89c\x0cV\x8d\x1b\x18\x18\x99k\x81\xb4\x06r\xefq\xcc\xdcL\xff\xc7v\xe6b&\x8f2\x83U\x1e\xf84\xf4\x13K\xf7\xd9\x9e\xd8V\xa4\x0e\x0fDP\x96\xe8}\xb7B\x8e\x11\x88wC\x10n\x0cT@\x14\x04,\x06\xb3\xd4\xf3\xb0u\xc1,\xa0\xec(lK0%\xd0\xb5\x11\xd4]0\x0b\xfd\x08\x0c=\xe7\xfb\xd1t\xcf\xf9\x1c\x1a\x00\xe5d\x94\x94\xaePi]8\xd7k\x9e\xebA\xd9+\x97G\x8aW\xf30V5\x82.\x11\xa7\x16\xe4P\xa2\x85Xp\x97Y\x88\x7fh\x18\x971\xa7G. \xe6\x04\x0317\x8d\xa1\xb4\x80\xc45F!m\x90t\xb3x\xf52\x14\xa2e\xd7?\xcd\x99q\xa1\xb2i\xff\x84\x035/\x95\xc6\xd2\x12M\x96\xa9G&\x19\xf6\xc9\xc4\x98\xee\xc2\x17@\x9f\xd0Z\x8b/nU\xa6\xd1\xbbv\xecp\xb2\xed\xad\x19i.~\x15m\'2\xe4\x0c\xc5\xd6\xc4F', chusihua.text)) try: 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' 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 if '欢迎您回来' in denlu: #获取分组、名字 fzmz = re.findall('欢迎您回来,(.*?),现在', denlu)[0] myprint(f'{fzmz}:登录成功') #获取formhash zbqd = session.get('https://bbs.binmt.cc/k_misign-sign.html', headers=headers).text formhash = re.findall('formhash" value="(.*?)".*? />', zbqd)[0] #签到 qdurl=f'https://bbs.binmt.cc/plugin.php?id=k_misign:sign&operation=qiandao&format=text&formhash={formhash}' qd = session.get(url=qdurl, headers=headers).text qdyz = re.findall('<(.*?)', qd)[0] myprint(f'签到状态:{qdyz}') if '已签' in qd: huoqu(formhash) else: myprint('登录失败') print(re.findall("CDATA(.*?)<", denlu)[0]) return True def huoqu(formhash): headers = {'User-Agent': ua} huo = session.get('https://bbs.binmt.cc/k_misign-sign.html', headers=headers).text pai = re.findall('您的签到排名:(.*?)', huo)[0] jiang = re.findall('id="lxreward" value="(.*?)">', huo)[0] myprint(f'签到排名{pai},奖励{jiang}金币') #退出登录,想要多用户必须,执行退出 tuic = f'https://bbs.binmt.cc/member.php?mod=logging&action=logout&formhash={formhash}' session.get(url=tuic, headers=headers) if __name__ == '__main__': #账号 username = '' #username.encode("utf-8") #密码 password = '' if 'mtluntan' in os.environ: fen = os.environ.get("mtluntan").split("@") myprint(f'查找到{len(fen)}个账号') myprint('==================================') for duo in fen: username,password = duo.split("&") try: main(username,password) myprint('============📣结束📣============') except Exception as e: pdcf = False pdcf1 = 1 while pdcf != True: if pdcf1 <=3: pdcf = main(username,password) else: pdcf = True else: myprint('不存在青龙、github变量') if username == '' or password == '': myprint('本地账号密码为空') exit() else: try: main(username,password) except Exception as e: pdcf = False pdcf1 = 1 while pdcf != True: if pdcf1 <=3: pdcf = main(username,password) else: pdcf = True try: send_notification_message(title='mt论坛') # 发送通知 except Exception as e: print('小错误')