From d6ee7c42ea4842b071f20389becb97e7cb8ef340 Mon Sep 17 00:00:00 2001 From: wd210010 <76995206+wd210010@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:01:23 +0800 Subject: [PATCH] Update zgfc.py --- zgfc.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/zgfc.py b/zgfc.py index f7e4731..cfd9a1b 100644 --- a/zgfc.py +++ b/zgfc.py @@ -6,7 +6,7 @@ # ------------------------------- # cron "0 0 8 * * *" script-path=xxx.py,tag=匹配cron用 # const $ = new Env('福彩抽奖') -import requests,json,os +import requests,json,os,time #活动路径 中国福彩公众号 右下角新年活动 #手机号登录后 抓取https://ssqcx-serv.cwlo.com.cn域名下的请求头的Authorization 放入青龙变量或者放入config.sh 变量名为zgfcau 放在config.sh的话 多账号用&分割 放在青龙变量就多建几个变量 @@ -45,18 +45,20 @@ for i in range(len(zgfcaulist)): print('该Authorization可能无效!') print('**开始抽奖**') try: - resp2 = requests.post('https://ssqcx-serv.cwlo.com.cn/api/lottery/start', headers=headers) - result2 = json.loads(resp2.text) - # print(result2) - success = result2['msg'] - if success =='成功' and len(result2['data']['lottery_sn'])>0: - massage = f'账号{i+1}中奖了!请自行查看' - print(massage) - Push(contents=massage) - elif success =='成功' and len(result2['data']['lottery_sn'])==0: - print('未中奖') - else: - print(success) + for i in range(3): + resp2 = requests.post('https://ssqcx-serv.cwlo.com.cn/api/lottery/start', headers=headers) + result2 = json.loads(resp2.text) + # print(result2) + success = result2['msg'] + if success =='成功' and len(result2['data']['lottery_sn'])>0: + massage = f'账号{i+1}中奖了!请自行查看' + print(massage) + Push(contents=massage) + elif success =='成功' and len(result2['data']['lottery_sn'])==0: + print('未中奖') + else: + print(success) + time.sleep(3) except: print('该Authorization可能无效!') print(wishidlist)