From 6354c983333b52e0bb3864b9523a2a4b2f573154 Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Sat, 14 Jun 2025 19:47:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96report.py=E5=92=8Crepo?= =?UTF-8?q?rt=5Fvideo.py=E4=B8=AD=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=A7=86=E9=A2=91=E8=AF=84=E8=AE=BA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report.py | 4 +--- report_video.py | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report.py b/report.py index 3d7f0e7..fec1778 100644 --- a/report.py +++ b/report.py @@ -16,9 +16,7 @@ while True: start_time = int(time.time()) lis = db.get_report_video() - if len(lis) == 0: - time.sleep(60 * 5) - else: + if len(lis) > 0: for li in lis: logger.logger.info(f"name:{li['name_title']},link:{li['link']} ") try: diff --git a/report_video.py b/report_video.py index 9b34b66..2b68983 100644 --- a/report_video.py +++ b/report_video.py @@ -286,8 +286,10 @@ class DailymotionClient: span_show = self.page.locator('span.comment-show-container-content') if span_show.count() > 0: span_show.nth(0).click() + self.page.wait_for_timeout(1000) textarea = self.page.locator('#request_comment_body') - textarea.fill(txt) + textarea.type(txt, delay=30) + self.page.wait_for_timeout(1000) self.page.get_by_role("button", name="Submit").click() self.page.wait_for_selector("span.status-label", timeout=30000) @@ -296,7 +298,7 @@ class DailymotionClient: span_show.nth(0).click() pic_path = f'screenshots/{str(int(time.time()))}_{report_id}.png' self.page.screenshot(path=pic_path) - return 1 + return 1, pic_path elif "open" in subsequent_status: return 1,""