更改显示比例增加发视频等待时间
This commit is contained in:
@@ -270,6 +270,7 @@ def retry_get_new_video(page, cookies, video_count):
|
||||
page.query_selector_all('//img[@alt="View photo"]')[0].hover()
|
||||
page.query_selector_all('//img[@alt="View photo"]')[0].click()
|
||||
page.reload()
|
||||
time.sleep(random.randint(3, 5))
|
||||
return page.url
|
||||
|
||||
# 计算下一次重试时间
|
||||
@@ -296,6 +297,7 @@ def playwright_post(cookies, content, image_key=None):
|
||||
context = browser.new_context(no_viewport=True)
|
||||
context.add_cookies(parse_cookies(cookies))
|
||||
page = context.new_page()
|
||||
page.evaluate(f'document.body.style.zoom = "{const.DISPLAY_SCALE}"')
|
||||
|
||||
check_account_status(page, parse_cookies(cookies))
|
||||
# 声明默认发布视频数量
|
||||
@@ -335,6 +337,7 @@ def playwright_post(cookies, content, image_key=None):
|
||||
# 视频格式要单独去获取链接
|
||||
if ".mp4" in image_key:
|
||||
post_url = retry_get_new_video(page, cookies, video_count)
|
||||
time.sleep(random.randint(3, 10))
|
||||
|
||||
except Error as e:
|
||||
raise OperationFailed(f'操作超时,请重试{e}')
|
||||
|
||||
Reference in New Issue
Block a user