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,""