|
|
@ -11,6 +11,7 @@ from rich.progress import track
|
|
|
|
from utils import settings
|
|
|
|
from utils import settings
|
|
|
|
from utils.console import print_step, print_substep
|
|
|
|
from utils.console import print_step, print_substep
|
|
|
|
from utils.imagenarator import imagemaker
|
|
|
|
from utils.imagenarator import imagemaker
|
|
|
|
|
|
|
|
from utils.playwright import clear_cookie_by_name
|
|
|
|
|
|
|
|
|
|
|
|
from utils.videos import save_data
|
|
|
|
from utils.videos import save_data
|
|
|
|
|
|
|
|
|
|
|
@ -130,6 +131,13 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int):
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
page.wait_for_load_state()
|
|
|
|
page.wait_for_load_state()
|
|
|
|
|
|
|
|
# Handle the redesign
|
|
|
|
|
|
|
|
# Check if the redesign optout cookie is set
|
|
|
|
|
|
|
|
if page.locator("#redesign-beta-optin-btn").is_visible():
|
|
|
|
|
|
|
|
# Clear the redesign optout cookie
|
|
|
|
|
|
|
|
clear_cookie_by_name(context, "redesign_optout")
|
|
|
|
|
|
|
|
# Reload the page for the redesign to take effect
|
|
|
|
|
|
|
|
page.reload()
|
|
|
|
# Get the thread screenshot
|
|
|
|
# Get the thread screenshot
|
|
|
|
page.goto(reddit_object["thread_url"], timeout=0)
|
|
|
|
page.goto(reddit_object["thread_url"], timeout=0)
|
|
|
|
page.set_viewport_size(ViewportSize(width=W, height=H))
|
|
|
|
page.set_viewport_size(ViewportSize(width=W, height=H))
|
|
|
|