|
|
@ -19,14 +19,14 @@ def download_screenshots_of_reddit_posts(reddit_object, screenshot_num, theme):
|
|
|
|
# ! Make sure the reddit screenshots folder exists
|
|
|
|
# ! Make sure the reddit screenshots folder exists
|
|
|
|
Path("assets/png").mkdir(parents=True, exist_ok=True)
|
|
|
|
Path("assets/png").mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
with sync_playwright() as p:
|
|
|
|
with sync_playwright() as browser_:
|
|
|
|
print_substep("Launching Headless Browser...")
|
|
|
|
print_substep("Launching Headless Browser...")
|
|
|
|
|
|
|
|
|
|
|
|
browser = p.chromium.launch()
|
|
|
|
browser = browser_.chromium.launch()
|
|
|
|
context = browser.new_context()
|
|
|
|
context = browser.new_context()
|
|
|
|
|
|
|
|
|
|
|
|
if theme.casefold() == "dark":
|
|
|
|
if theme.casefold() == "dark":
|
|
|
|
cookie_file = open("video_creation/cookies.json")
|
|
|
|
with open("video_creation/cookies.json", encoding="utf-8") as cookie_file:
|
|
|
|
cookies = json.load(cookie_file)
|
|
|
|
cookies = json.load(cookie_file)
|
|
|
|
context.add_cookies(cookies)
|
|
|
|
context.add_cookies(cookies)
|
|
|
|
|
|
|
|
|
|
|
|