From d30b34b93bc1d9529cb51bb468a83d19a4237b76 Mon Sep 17 00:00:00 2001 From: shitao <133397418@qq.com> Date: Sun, 14 Jan 2024 10:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=8A=9F=E8=83=BD(iqiyi/main.py):?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E8=A7=A3=E6=9E=90=5F=5Fdfp=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20=E2=9C=A8=20=E5=8A=9F=E8=83=BD(iqiyi/main.?= =?UTF-8?q?py):=20=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E8=A7=82=E7=9C=8B?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E7=9A=84=E5=87=BD=E6=95=B0=20=E2=9C=A8=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD(iqiyi/main.py):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A2=86=E5=8F=96V7=E7=89=B9=E6=9D=83=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=20=E2=9C=A8=20=E5=8A=9F=E8=83=BD(iqiyi/main.py):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=B7=E8=A7=82=E7=9C=8B=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BC=98=E5=8C=96=E6=8A=BD?= =?UTF-8?q?=E5=A5=96=E9=80=BB=E8=BE=91=20=E2=9C=A8=20=E5=8A=9F=E8=83=BD(iq?= =?UTF-8?q?iyi/main.py):=20=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=A2=91=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E5=92=8CV7=E7=89=B9=E6=9D=83=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dailycheckin/iqiyi/main.py | 140 ++++++++++++++++++++++++++++++++++++- 1 file changed, 137 insertions(+), 3 deletions(-) diff --git a/dailycheckin/iqiyi/main.py b/dailycheckin/iqiyi/main.py index 5f017d300..cb3469bdd 100755 --- a/dailycheckin/iqiyi/main.py +++ b/dailycheckin/iqiyi/main.py @@ -2,7 +2,9 @@ import os import re import time +from random import randint from urllib.parse import unquote +from uuid import uuid4 import requests @@ -32,7 +34,12 @@ def parse_cookie(cookie): if re.findall(r"P00003=(.*?);", cookie) else "" ) - return p00001, p00002, p00003 + __dfp = ( + re.findall(r"__dfp=(.*?);", cookie)[0] + if re.findall(r"__dfp=(.*?);", cookie) + else "" + ) + return p00001, p00002, p00003, __dfp @staticmethod def user_information(p00001): @@ -198,9 +205,134 @@ def draw(draw_type, p00001, p00003): msg = res["errorReason"] return {"status": False, "msg": msg, "chance": 0} + def get_watch_time(self, p00001): + url = "https://tc.vip.iqiyi.com/growthAgency/watch-film-duration" + data = requests.get( + url=url, + headers={ + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0", + "Cookie": f"P00001={p00001}", + "Content-Type": "application/json", + }, + ).json() + watch_time = data["data"]["viewtime"]["time"] + return watch_time + + def level_right(self, p00001): + data = {"code": "k8sj74234c683f", "P00001": p00001} + res = requests.post( + url="https://act.vip.iqiyi.com/level-right/receive", data=data + ).json() + msg = res["msg"] + return [ + { + "name": "V7 免费升级星钻", + "value": msg, + } + ] + + def start_watch(self, p00001, p00003, dfp): + total_time = self.get_watch_time(p00001=p00001) + print(f"现在已经刷到了 {total_time}秒, 数据同步有延迟, 仅供参考") + if total_time >= 7200: + return { + "name": "视频时长", + "value": f"已经刷了 {total_time}秒, 数据同步有延迟, 仅供参考", + } + for _ in range(150): + tm = randint(60, 120) + watch_time_url = "https://msg.qy.net/b" + params = { + "u": "f600a23f03c26507f5482e6828cfc6c5", + "pu": p00003, + "p1": "1_10_101", + "v": "5.2.66", + "ce": uuid4().hex, + "de": "1616773143.1639632721.1639653680.29", + "c1": "2", + "ve": uuid4().hex, + "ht": "0", + "pt": randint(1000000000, 9999999999) / 1000000, + "isdm": "0", + "duby": "0", + "ra": "5", + "clt": "", + "ps2": "DIRECT", + "ps3": "", + "ps4": "", + "br": "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/96.0.4664.110 safari/537.36", + "mod": "cn_s", + "purl": "https://www.iqiyi.com/v_1eldg8u3r08.html?vfrm=pcw_home&vfrmblk=712211_cainizaizhui&vfrmrst=712211_cainizaizhui_image1&r_area=rec_you_like&r_source=62%40128&bkt=MBA_PW_T3_53&e=b3ec4e6c74812510c7719f7ecc8fbb0f&stype=2", + "tmplt": "2", + "ptid": "01010031010000000000", + "os": "window", + "nu": "0", + "vfm": "", + "coop": "", + "ispre": "0", + "videotp": "0", + "drm": "", + "plyrv": "", + "rfr": "https://www.iqiyi.com/", + "fatherid": f"{randint(1000000000000000, 9999999999999999)}", + "stauto": "1", + "algot": "abr_v12-rl", + "vvfrom": "", + "vfrmtp": "1", + "pagev": "playpage_adv_xb", + "engt": "2", + "ldt": "1", + "krv": "1.1.85", + "wtmk": "0", + "duration": f"{randint(1000000, 9999999)}", + "bkt": "", + "e": "", + "stype": "", + "r_area": "", + "r_source": "", + "s4": f"{randint(100000, 999999)}_dianshiju_tbrb_image2", + "abtest": "1707_B,1550_B", + "s3": f"{randint(100000, 999999)}_dianshiju_tbrb", + "vbr": f"{randint(100000, 999999)}", + "mft": "0", + "ra1": "2", + "wint": "3", + "s2": "pcw_home", + "bw": "10", + "ntwk": "18", + "dl": f"{randint(10, 999)}.27999999999997", + "rn": f"0.{randint(1000000000000000, 9999999999999999)}", + "dfp": dfp, + "stime": str(time.time() * 1000), + "r": f"{randint(1000000000000000, 9999999999999999)}", + "hu": "1", + "t": "2", + "tm": str(tm), + "_": str(time.time() * 1000), + } + requests.get( + url=watch_time_url, + headers={ + "User-Agent": "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/96.0.4664.110 safari/537.36", + "Cookie": f"P00001={p00001}", + "Content-Type": "application/json", + }, + params=params, + ) + total_time += tm + print(f"现在已经刷到了 {total_time}秒, 数据同步有延迟, 仅供参考") + if total_time >= 7600: + break + return { + "name": "视频时长", + "value": f"已经刷了 {total_time}秒, 数据同步有延迟, 仅供参考", + } + def main(self): - p00001, p00002, p00003 = self.parse_cookie(self.check_item.get("cookie")) + p00001, p00002, p00003, dfp = self.parse_cookie(self.check_item.get("cookie")) sign_msg = self.sign(p00001=p00001) + watch_msg = self.start_watch(p00001=p00001, p00003=p00003, dfp=dfp) + level_right_msg = self.level_right(p00001=p00001) chance = self.draw(0, p00001=p00001, p00003=p00003)["chance"] if chance: draw_msg = "" @@ -210,7 +342,7 @@ def main(self): else: draw_msg = "抽奖机会不足" task_msg = "" - for one in range(6): + for _ in range(6): task_list = self.query_user_task(p00001=p00001) self.join_task(p00001=p00001, task_list=task_list) time.sleep(10) @@ -237,6 +369,8 @@ def main(self): task_msg, {"name": "抽奖奖励", "value": draw_msg}, ] + + [watch_msg] + + level_right_msg ) msg = "\n".join([f"{one.get('name')}: {one.get('value')}" for one in msg]) return msg