fix: 优化report.py和report_video.py中的逻辑,改进视频评论提交流程

This commit is contained in:
晓丰 2025-06-14 19:47:33 +08:00
parent ef704a80c5
commit 6354c98333
2 changed files with 5 additions and 5 deletions

View File

@ -16,9 +16,7 @@ while True:
start_time = int(time.time()) start_time = int(time.time())
lis = db.get_report_video() lis = db.get_report_video()
if len(lis) == 0: if len(lis) > 0:
time.sleep(60 * 5)
else:
for li in lis: for li in lis:
logger.logger.info(f"name:{li['name_title']},link:{li['link']} ") logger.logger.info(f"name:{li['name_title']},link:{li['link']} ")
try: try:

View File

@ -286,8 +286,10 @@ class DailymotionClient:
span_show = self.page.locator('span.comment-show-container-content') span_show = self.page.locator('span.comment-show-container-content')
if span_show.count() > 0: if span_show.count() > 0:
span_show.nth(0).click() span_show.nth(0).click()
self.page.wait_for_timeout(1000)
textarea = self.page.locator('#request_comment_body') 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.get_by_role("button", name="Submit").click()
self.page.wait_for_selector("span.status-label", timeout=30000) self.page.wait_for_selector("span.status-label", timeout=30000)
@ -296,7 +298,7 @@ class DailymotionClient:
span_show.nth(0).click() span_show.nth(0).click()
pic_path = f'screenshots/{str(int(time.time()))}_{report_id}.png' pic_path = f'screenshots/{str(int(time.time()))}_{report_id}.png'
self.page.screenshot(path=pic_path) self.page.screenshot(path=pic_path)
return 1 return 1, pic_path
elif "open" in subsequent_status: elif "open" in subsequent_status:
return 1,"" return 1,""