fix: 优化report.py和report_video.py中的逻辑,改进视频评论提交流程
This commit is contained in:
parent
ef704a80c5
commit
6354c98333
@ -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:
|
||||
|
@ -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,""
|
||||
|
Loading…
x
Reference in New Issue
Block a user