gaoyuan 8 months ago
parent d0e3f8609f
commit 091f1c7e7b

@ -8,7 +8,8 @@ import base64
import json
from aanotify import send
from notify import send
from notify import sendEmail
# 微信公众号@爱上羊毛侠 二次开发
@ -51,8 +52,10 @@ def mt_add(itemId, shopId, sessionId, userId, token, Device_ID):
response = requests.post('https://app.moutai519.com.cn/xhr/front/mall/reservation/add', headers=headers,
json=json_data)
code = response.json().get('code', 0)
sendEmail('申购结束code:' + str(code) + ' ' + response.json().get('message', "未知原因"), '申购结束code:' + str(code) + ' ' + response.json().get('message', "未知原因"))
if code == 2000:
return response.json().get('data', {}).get('successDesc', "未知")
sendEmail('申购失败:' + response.json().get('message', "未知原因"), '申购失败:' + response.json().get('message', "未知原因"))
return '申购失败:' + response.json().get('message', "未知原因")
@ -258,6 +261,7 @@ def login(phone, vCode, Device_ID):
if __name__ == '__main__':
sendEmail('茅台申购开始','茅台申购开始')
mt_tokens = os.getenv("MTTokenD")
mt_version = os.getenv("Mt_Version")
if not mt_tokens:
@ -303,6 +307,11 @@ if __name__ == '__main__':
s += userName + '_' + mobile + '---------------' + \
"小茅运:" + r + '\n'
s += userName + '_' + mobile + "正常结束任务"+'\n \n'
if "失败" in s:
sendEmail('茅台申购失败',s)
else :
sendEmail('茅台申购成功',s)
except Exception as e:
s += userName + '_' + mobile + "异常信息"+e
sendEmail('茅台申购异常结束',s)
send("i茅台申购+小茅运", s)
Loading…
Cancel
Save