修改咪哒活动
This commit is contained in:
parent
38ecdf3481
commit
eb558bb1ed
20
md_ktv.py
20
md_ktv.py
@ -11,22 +11,25 @@
|
||||
#
|
||||
# cron "30 7,18 * * *" script-path=xxx.py,tag=匹配cron用
|
||||
# const $ = new Env('咪哒KTV签到')
|
||||
from random import random
|
||||
|
||||
import requests, json
|
||||
import os
|
||||
import urllib3
|
||||
import random
|
||||
from wxpusher import WxPusher
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
md_ktv_cookie = os.getenv("md_ktv_cookie").split('\n')
|
||||
md_ktv_cookie = [
|
||||
'1093049864@AY0-xf4s59zE_Cf6FtqrmLNNXrukcSdWyKFz3AdMEAY.KkAKKvYSMgofx6Kbm8aZ_huwqedgOLU_0kcmYkdzNqo@UID_iEX04ORBuLG5ch5B3tbqBUx3G8SP']
|
||||
# md_ktv_cookie = os.getenv("md_ktv_cookie").split('\n')
|
||||
|
||||
# AI评分主题id
|
||||
ai_themeId = 129
|
||||
# 投票活动主题id
|
||||
vote_themeId = 130
|
||||
|
||||
|
||||
|
||||
# 签到
|
||||
def to_sign():
|
||||
data = {
|
||||
@ -36,6 +39,8 @@ def to_sign():
|
||||
|
||||
# 添加 verify=False 来忽略SSL证书验证
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
if json.loads(response.text)['success']:
|
||||
print('签到成功')
|
||||
|
||||
|
||||
# 播放录音15s +2
|
||||
@ -47,6 +52,8 @@ def play_record():
|
||||
|
||||
# 添加 verify=False 来忽略SSL证书验证
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
if json.loads(response.text)['success']:
|
||||
print('完成播放录音15s任务')
|
||||
|
||||
|
||||
# 点赞 +1
|
||||
@ -62,6 +69,8 @@ def to_like():
|
||||
|
||||
like_url = "https://mk-gateway-pro.singworld.cn/mk-outside/api/favor/create"
|
||||
response = requests.post(like_url, headers=headers, json=data, verify=False)
|
||||
if json.loads(response.text)['success']:
|
||||
print('点赞成功')
|
||||
|
||||
|
||||
# 投票 +1
|
||||
@ -91,6 +100,7 @@ def to_vote():
|
||||
# 添加 verify=False 来忽略SSL证书验证
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
if not json.loads(response.text)['success']:
|
||||
print('投票成功')
|
||||
break
|
||||
|
||||
|
||||
@ -117,7 +127,7 @@ def ai_score():
|
||||
url = "https://mk-gateway-pro.singworld.cn/mk-outside/api/event/getDetailList"
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
# 获取对应的optionId
|
||||
optionId = json.loads(response.text)['data']['optionId']
|
||||
optionId = json.loads(response.text)['data'][0]['optionId']
|
||||
# 进行评分 5~10分
|
||||
score = random.randint(5, 8)
|
||||
data = {
|
||||
@ -126,6 +136,8 @@ def ai_score():
|
||||
}
|
||||
url = "https://mk-gateway-pro.singworld.cn/mk-outside/api/event/setScore"
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
if json.loads(response.text)['success']:
|
||||
print('AI评分成功')
|
||||
|
||||
|
||||
# 领取所有咪豆
|
||||
|
||||
Loading…
Reference in New Issue
Block a user