修改ktv

This commit is contained in:
zhangdongxu 2024-02-22 13:20:39 +08:00
parent 583eea7b78
commit b3dfbb6cb2

View File

@ -21,6 +21,7 @@ from wxpusher import WxPusher
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
md_ktv_cookie = os.getenv("md_ktv_cookie").split('\n')
# md_ktv_cookie = ['1093049864@PZhaGyo6ao8oVw03_Re-LkKH98_kLZzngBzNSZC2bB0.7X7SpCW4Tz30Wf_tbXpeJc8zJokr_a34fYYNoxzPP3U@UID_iEX04ORBuLG5ch5B3tbqBUx3G8SP']
# AI评分主题id
ai_themeId = 132
@ -59,8 +60,17 @@ def to_sign():
# 添加 verify=False 来忽略SSL证书验证
response = requests.post(url, headers=headers, json=data, verify=False)
print(response.text)
if json.loads(response.text)['msg'] == 'invalid token':
# print('token失效,跳过该帐号,账号为:' + uid)
# 给推送uid推送消息
WxPusher.send_message('token失效,请重新获取',
uids=[wxpusher_uid],
token='AT_uj0Ezms54MZVD3xO5R5i1Wh3vR7nMety')
return False
if json.loads(response.text)['success']:
print('签到成功')
return True
# 播放录音15s +2
@ -226,6 +236,7 @@ def get_all_mido():
min_price) + '咪豆' + '\n'
else:
content += '当前咪豆数量:' + str(score) + ',没有可兑换的商品'
content += '注意兑换商品需要至少消费过1次否则无法兑换'
WxPusher.send_message('咪哒K歌签到成功,当前咪豆数量:' + str(score) + '\n' + content + '\n',
uids=[wxpusher_uid],
token='AT_uj0Ezms54MZVD3xO5R5i1Wh3vR7nMety')
@ -263,7 +274,8 @@ if __name__ == '__main__':
# 获取活动主题列表
get_theme_list()
# 1.签到
to_sign()
if not to_sign():
continue
# 2.播放录音15s +2
play_record()
# 3.点赞 +1