From f548f26ec1c6f269c17e99b9acf69ecffd0c488d Mon Sep 17 00:00:00 2001 From: shitao <133397418@qq.com> Date: Wed, 15 May 2024 09:53:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20=E5=8A=9F=E8=83=BD(main.py)?= =?UTF-8?q?=EF=BC=9A=E6=9B=B4=E6=96=B0=E7=AD=BE=E5=88=B0=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BB=A5=E9=80=82=E5=BA=94=E6=9C=80=E6=96=B0=E7=9A=84=E7=88=B1?= =?UTF-8?q?=E5=A5=87=E8=89=BAAPI=20=20=20=E2=99=BB=EF=B8=8F=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84(main.py)=EF=BC=9A=E4=BC=98=E5=8C=96=E4=BA=86cookie?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BB=8Ecookie=E4=B8=AD=E8=8E=B7=E5=8F=96qyi?= =?UTF-8?q?d=20=20=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D(main.py)=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=AD=BE=E5=88=B0=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E5=B8=B8=E7=AD=BE=E5=88=B0=E5=B9=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=AD=BE=E5=88=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dailycheckin/iqiyi/main.py | 54 ++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/dailycheckin/iqiyi/main.py b/dailycheckin/iqiyi/main.py index 9311c3b..e489bc4 100755 --- a/dailycheckin/iqiyi/main.py +++ b/dailycheckin/iqiyi/main.py @@ -40,7 +40,13 @@ class IQIYI(CheckIn): if re.findall(r"__dfp=(.*?);", cookie) else "" ) - return p00001, p00002, p00003, __dfp + __dfp = __dfp.split("@")[0] + qyid = ( + re.findall(r"QC005=(.*?);", cookie)[0] + if re.findall(r"QC005=(.*?);", cookie) + else "" + ) + return p00001, p00002, p00003, __dfp, qyid @staticmethod def user_information(p00001): @@ -76,29 +82,47 @@ class IQIYI(CheckIn): ] return msg - def sign(self, p00001, p00003): + def k(self, secret_key, data, split="|"): + result_string = split.join(f"{key}={data[key]}" for key in sorted(data)) + return md5((result_string + split + secret_key).encode("utf-8")).hexdigest() + + def sign(self, p00001, p00003, dfp, qyid): """ VIP 签到 """ - qyid = uuid4().hex[:16] time_stamp = int(time.time() * 1000) - data = f"agentType=1|agentversion=1|appKey=basic_pcw|authCookie={p00001}|qyid={qyid}|task_code=natural_month_sign|timestamp={time_stamp}|typeCode=point|userId={p00003}|UKobMjDMsDoScuWOfp6F" - sign = md5(data.encode(encoding="utf-8")).hexdigest() - url = f"https://community.iqiyi.com/openApi/task/execute?agentType=1&agentversion=1&appKey=basic_pcw&authCookie={p00001}&qyid={qyid}&sign={sign}&task_code=natural_month_sign×tamp={time_stamp}&typeCode=point&userId={p00003}" - body = { + sign_date = { + "agenttype": 20, + "agentversion": "15.4.6", + "appKey": "lequ_rn", + "appver": "15.4.6", + "authCookie": p00001, + "qyid": qyid, + "srcplatform": 20, + "task_code": "natural_month_sign", + "timestamp": time_stamp, + "userId": p00003, + } + sign = self.k("cRcFakm9KSPSjFEufg3W", sign_date) + sign_date["sign"] = sign + data = { "natural_month_sign": { + "verticalCode": "iQIYI", "taskCode": "iQIYI_mofhr", - "agentType": 1, - "agentversion": 1, "authCookie": p00001, "qyid": qyid, - "verticalCode": "iQIYI", + "agentType": 20, + "agentVersion": "15.4.6", + "dfp": dfp, + "signFrom": 1, } } + url = "https://community.iqiyi.com/openApi/task/execute" res = requests.post( url=url, - data=json.dumps(body), - headers={"Cookie": f"P00001={p00001}", "Content-Type": "application/json"}, + params=sign_date, + data=json.dumps(data), + headers={"Content-Type": "application/json"}, ).json() if res["code"] == "A00000": _msg = res["data"]["msg"] @@ -407,7 +431,9 @@ class IQIYI(CheckIn): return [{"name": "白金抽奖", "value": "未中奖"}] def main(self): - p00001, p00002, p00003, dfp = self.parse_cookie(self.check_item.get("cookie")) + p00001, p00002, p00003, dfp, qyid = self.parse_cookie( + self.check_item.get("cookie") + ) try: user_info = json.loads(unquote(p00002, encoding="utf-8")) user_name = user_info.get("user_name") @@ -417,7 +443,7 @@ class IQIYI(CheckIn): print(f"获取账号信息失败,错误信息: {e}") nickname = "未获取到,请检查 Cookie 中 P00002 字段" user_name = "未获取到,请检查 Cookie 中 P00002 字段" - sign_msg = self.sign(p00001=p00001, p00003=p00003) + sign_msg = self.sign(p00001=p00001, p00003=p00003, dfp=dfp, qyid=qyid) _user_msg = self.user_information(p00001=p00001) lotto_lottery_msg = self.lotto_lottery(p00001=p00001) if _user_msg[4].get("value") != "非 VIP 用户": From 4067f3c6df3c1991ca7d6b82eaaeed9e412cb0a1 Mon Sep 17 00:00:00 2001 From: shitao <133397418@qq.com> Date: Wed, 15 May 2024 09:55:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=E5=8D=87=E7=BA=A7(=5F?= =?UTF-8?q?=5Fversion=5F=5F.py)=EF=BC=9A=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E4=BB=8E24.3.19=E5=88=B024.5.15=20=20=20?= =?UTF-8?q?=F0=9F=93=9D=20=E6=B7=BB=E5=8A=A0=E6=96=87=E6=A1=A3(2024-05-15.?= =?UTF-8?q?mdx)=EF=BC=9A=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=91=E5=B8=83=E8=AE=B0=E5=BD=95=20=20=20=E2=9C=A8?= =?UTF-8?q?=20=E5=8A=9F=E8=83=BD(=5Fmeta.json)=EF=BC=9A=E5=9C=A8meta?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=A5=E6=9C=9F=20=20=20=F0=9F=92=A1=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A(theme.config.tsx)=EF=BC=9A?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8F=91=E5=B8=83=E6=A8=AA=E5=B9=85=E7=9A=84?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=92=8C=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dailycheckin/__version__.py | 2 +- docs/pages/history/2024-05-15.mdx | 7 +++++++ docs/pages/history/_meta.json | 1 + docs/theme.config.tsx | 6 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 docs/pages/history/2024-05-15.mdx diff --git a/dailycheckin/__version__.py b/dailycheckin/__version__.py index ac04dc3..cc7e686 100755 --- a/dailycheckin/__version__.py +++ b/dailycheckin/__version__.py @@ -1 +1 @@ -__version__ = "24.3.19" +__version__ = "24.5.15" diff --git a/docs/pages/history/2024-05-15.mdx b/docs/pages/history/2024-05-15.mdx new file mode 100644 index 0000000..406825e --- /dev/null +++ b/docs/pages/history/2024-05-15.mdx @@ -0,0 +1,7 @@ +# 2024-05-15 + +![PyPI](https://img.shields.io/badge/Pypi-v24.5.15-brightgreen) + +## 🐛 修复 + +- 修复「爱奇艺」签到失效的问题 diff --git a/docs/pages/history/_meta.json b/docs/pages/history/_meta.json index 35951da..5305573 100644 --- a/docs/pages/history/_meta.json +++ b/docs/pages/history/_meta.json @@ -1,4 +1,5 @@ { + "2024-05-15": "2024-05-15", "2024-03-19": "2024-03-19", "2024-03-11": "2024-03-11", "2024-03-07": "2024-03-07", diff --git a/docs/theme.config.tsx b/docs/theme.config.tsx index 76be7b1..049040c 100644 --- a/docs/theme.config.tsx +++ b/docs/theme.config.tsx @@ -72,13 +72,13 @@ const config: DocsThemeConfig = { } }, banner: { - key: '2024.3.19-release', + key: '2024.5.15-release', text: ( - 🎉 DailyCheckIn 2024.3.19 is released. Read more → + 🎉 DailyCheckIn 2024.5.15 is released. Read more → ), },