mirror of
https://github.com/linbailo/zyqinglong.git
synced 2026-01-17 14:20:44 +08:00
修改变量方式
This commit is contained in:
parent
ea1d034403
commit
ace779810e
24
mt.py
24
mt.py
@ -2,11 +2,10 @@
|
|||||||
mt论坛自动签到
|
mt论坛自动签到
|
||||||
|
|
||||||
暂不支持多个账号,我知道你们肯定没有这个需求
|
暂不支持多个账号,我知道你们肯定没有这个需求
|
||||||
|
添加变量mtluntan
|
||||||
账号变量 mtusername
|
账号密码用&隔开
|
||||||
密码变量 mtpassword
|
例如账号:10086 密码:1001 则变量为10086&1001
|
||||||
export mtusername=""
|
export mtluntan=""
|
||||||
export mtpassword=""
|
|
||||||
|
|
||||||
cron: 0 0,7 * * *
|
cron: 0 0,7 * * *
|
||||||
const $ = new Env("mt论坛");
|
const $ = new Env("mt论坛");
|
||||||
@ -22,6 +21,7 @@ import time
|
|||||||
ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36'
|
ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36'
|
||||||
session = requests.session()
|
session = requests.session()
|
||||||
|
|
||||||
|
|
||||||
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/member.php?mod=logging&action=login&infloat=yes&handlekey=login&inajax=1&ajaxtarget=fwin_content_login',headers=headers)
|
||||||
@ -56,16 +56,16 @@ if __name__ == '__main__':
|
|||||||
#username.encode("utf-8")
|
#username.encode("utf-8")
|
||||||
#密码
|
#密码
|
||||||
password = ''
|
password = ''
|
||||||
if 'mtusername' in os.environ:
|
if 'mtluntan' in os.environ:
|
||||||
username = os.environ.get("mtusername")
|
mtluntan = os.environ.get("mtluntan").split("&")
|
||||||
|
username = mtluntan[0]
|
||||||
|
password = mtluntan[1]
|
||||||
else:
|
else:
|
||||||
print('不存在青龙、github变量')
|
print('不存在青龙、github变量')
|
||||||
exit
|
if username == '' or password == '':
|
||||||
if 'mtpassword' in os.environ:
|
print('本地账号密码为空')
|
||||||
password = os.environ.get("mtpassword")
|
exit()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
main(username,password)
|
main(username,password)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user