From 6e6ab61998fb8043522ea5702ad644c7a044fa99 Mon Sep 17 00:00:00 2001 From: kalifranklin Date: Fri, 18 Jul 2025 00:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=94=99=E8=AF=AF=E9=87=8D?= =?UTF-8?q?=E8=AF=95=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report_video.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/report_video.py b/report_video.py index 909aa5d..494ae49 100644 --- a/report_video.py +++ b/report_video.py @@ -305,12 +305,28 @@ class DailymotionClient: @require_login def report_follow_up(self, report_id: str): - txt = "I am the authorized agent of Beijing iQIYI Technology Co., Ltd., responsible for dealing with unauthorized overseas distribution of pirated videos of our works.We have confirmed that the above links contain infringing content and we insist on requesting to takedown. Thank you!" - self.page.goto("https://faq.dailymotion.com/hc/en-us/requests/{}".format(report_id), timeout=30000) - self.page.wait_for_selector("span.status-label", timeout=30000) + max_retries = 3 # 最大重试次数 + retry_delay = 2 # 重试间隔(秒) + loaded = False + subsequent_status = "" + # 重试页面加载和状态检测 + for attempt in range(max_retries): + try: + self.page.goto(f"https://faq.dailymotion.com/hc/en-us/requests/{report_id}", timeout=30000) + self.page.wait_for_selector("span.status-label", timeout=30000) + status_raw = self.page.locator("span.status-label").text_content() + subsequent_status = status_raw.strip().lower() if status_raw else None + loaded = True + break # 成功则跳出循环 + except Exception as e: + print(f"尝试 {attempt + 1}/{max_retries} 失败: {str(e)}") + if attempt < max_retries - 1: + time.sleep(retry_delay) + + if not loaded: + return 1, "页面加载失败" + txt = "I am the authorized agent of Beijing iQIYI Technology Co., Ltd., responsible for dealing with unauthorized overseas distribution of pirated videos of our works.We have confirmed that the above links contain infringing content and we insist on requesting to takedown. Thank you!" - status_raw = self.page.locator("span.status-label").text_content() - subsequent_status = status_raw.strip().lower() if status_raw else None if "awaiting your reply" in subsequent_status: span_show = self.page.locator('span.comment-show-container-content') if span_show.count() > 0: