From 7e0b17dde6a6b8d45d3cde09cd98c488567c7ac3 Mon Sep 17 00:00:00 2001 From: zhangdongxu Date: Mon, 29 Jan 2024 14:12:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B4=BB=E5=8A=A8id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md_ktv.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) 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]