From c623a6f15d113009db35b5aeb09ab08b7f70932e Mon Sep 17 00:00:00 2001 From: linlin <1628708538@qq.com> Date: Tue, 6 May 2025 14:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=88=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsthb.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tsthb.py b/tsthb.py index 3fd1ca6..3df62b2 100644 --- a/tsthb.py +++ b/tsthb.py @@ -18,11 +18,12 @@ import re import os import time import json +from datetime import datetime #初始化 print('============📣初始化📣============') #版本 github_file_name = 'tsthb.py' -sjgx = '2025-04-17T21:30:11.000+08:00' +sjgx = '2025-05-10T21:30:11.000+08:00' version = '1.46.8' try: @@ -33,6 +34,14 @@ except Exception as e: print('小错误') +# 获取日期距离计算id +def months_between_dates(d1): + d2 = datetime.today() + d1 = datetime.strptime(d1, "%Y-%m-%d") + months = (d2.year - d1.year) * 12 + d2.month - d1.month + return months + + # 发送通知消息 def send_notification_message(title): @@ -79,6 +88,13 @@ def qdsj(ck): # activityId = re.findall('activityId%2522%253A(.*?)%257D',qd)[0] print(f"获取到本月签到代码:{activityId}") #activityId = json.loads(qd)['activityId'] + elif '签到' in i['bannerName']: + # print(i) + qd = i['jumpPara'] + activityId = json.loads(qd)['activityId'] + # activityId = re.findall('activityId%2522%253A(.*?)%257D',qd)[0] + print(f"获取到本月签到代码:{activityId}") + #activityId = json.loads(qd)['activityId'] return activityId @@ -90,7 +106,11 @@ def yx(ck): except Exception as e: activityId = '' if activityId == '': - activityId = 57 + danqryid = 59 + d1 = "2025-05-01" + months = months_between_dates(d1) + activityId = danqryid + int(months) + headers = {'user-token':ck,'version':version,'channel':'1'} dl = requests.get(url='https://sss-web.tastientech.com/api/intelligence/member/getMemberDetail',headers=headers).json() if dl['code'] == 200: