mirror of
https://github.com/linbailo/zyqinglong.git
synced 2026-01-12 11:10:42 +08:00
支持多用户
This commit is contained in:
parent
92fe2dd1e4
commit
40d9408e52
33
mt.py
33
mt.py
@ -1,10 +1,13 @@
|
|||||||
"""
|
"""
|
||||||
mt论坛自动签到
|
mt论坛自动签到
|
||||||
|
|
||||||
暂不支持多个账号,我知道你们肯定没有这个需求
|
支持多用户运行
|
||||||
添加变量mtlunt
|
添加变量mtluntan
|
||||||
账号密码用&隔
|
账号密码用&隔开
|
||||||
例如账号:10086 密码:1001 则变量为10086&1001
|
多用户用@隔开
|
||||||
|
例如账号1:10086 密码:1001
|
||||||
|
账号1:1234 密码:1234
|
||||||
|
则变量为10086&1001@1234&1234
|
||||||
export mtluntan=""
|
export mtluntan=""
|
||||||
|
|
||||||
cron: 0 0,7 * * *
|
cron: 0 0,7 * * *
|
||||||
@ -23,6 +26,7 @@ session = requests.session()
|
|||||||
|
|
||||||
#获取ip
|
#获取ip
|
||||||
ipdi = requests.get('http://ifconfig.me/ip', timeout=6).text.strip()
|
ipdi = requests.get('http://ifconfig.me/ip', timeout=6).text.strip()
|
||||||
|
print('============📣初始化📣============')
|
||||||
print(ipdi)
|
print(ipdi)
|
||||||
|
|
||||||
|
|
||||||
@ -35,6 +39,7 @@ if '中国' == country:
|
|||||||
else:
|
else:
|
||||||
print(f'{country}无法访问论坛')
|
print(f'{country}无法访问论坛')
|
||||||
exit()
|
exit()
|
||||||
|
print('==================================')
|
||||||
|
|
||||||
def main(username,password):
|
def main(username,password):
|
||||||
headers={'User-Agent': ua}
|
headers={'User-Agent': ua}
|
||||||
@ -85,13 +90,23 @@ if __name__ == '__main__':
|
|||||||
#密码
|
#密码
|
||||||
password = ''
|
password = ''
|
||||||
if 'mtluntan' in os.environ:
|
if 'mtluntan' in os.environ:
|
||||||
username,password = os.environ.get("mtluntan").split("&")
|
fen = os.environ.get("mtluntan").split("@")
|
||||||
|
print(f'查找到{len(fen)}个账号')
|
||||||
|
print('==================================')
|
||||||
|
for duo in fen:
|
||||||
|
username,password = duo.split("&")
|
||||||
|
try:
|
||||||
|
main(username,password)
|
||||||
|
print('============📣结束📣============')
|
||||||
|
except Exception as e:
|
||||||
|
raise e
|
||||||
else:
|
else:
|
||||||
print('不存在青龙、github变量')
|
print('不存在青龙、github变量')
|
||||||
if username == '' or password == '':
|
if username == '' or password == '':
|
||||||
print('本地账号密码为空')
|
print('本地账号密码为空')
|
||||||
exit()
|
exit()
|
||||||
try:
|
else:
|
||||||
main(username,password)
|
try:
|
||||||
except Exception as e:
|
main(username,password)
|
||||||
raise e
|
except Exception as e:
|
||||||
|
raise e
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user