diff --git a/md_ktv.py b/md_ktv.py index 743948f..283c224 100644 --- a/md_ktv.py +++ b/md_ktv.py @@ -23,11 +23,31 @@ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) md_ktv_cookie = os.getenv("md_ktv_cookie").split('\n') # AI评分主题id -ai_themeId = 129 +ai_themeId = 132 # 投票活动主题id -vote_themeId = 130 +vote_themeId = 133 +# 获取活动主题列表 +def get_themelist(): + global ai_themeId, vote_themeId # 声明全局变量 + + data = { + "page": 1, + "rows": 5 + } + url = "https://mk-gateway-pro.singworld.cn/mk-outside/api/theme/getThemeListJson" + response = requests.post(url, headers=headers, json=data, verify=False) + list = json.loads(response.text)['data']['list'] + # 只取前两个活动 + for i in range(2): + theme = list[i] + print('第' + str(i + 1) + '个主题名称:' + theme['themeName'] + ',主题id:' + str(theme['themeId'])) + if theme['themeType'] == 1: + vote_themeId = theme['id'] + elif theme['themeType'] == 2: + ai_themeId = theme['id'] + # 签到 def to_sign(): data = { @@ -211,6 +231,8 @@ def get_all_mido(): if __name__ == '__main__': + # 获取活动主题列表 + get_themelist() # 遍历所有帐号 for i in range(len(md_ktv_cookie)): cookie = md_ktv_cookie[i]