From e18695794b2fe59f37067b26823074dc311283c3 Mon Sep 17 00:00:00 2001 From: RqZen Date: Fri, 23 Feb 2024 21:16:35 +0100 Subject: [PATCH] NewRedditUI --- reddit/subreddit.py | 2 +- video_creation/screenshot_downloader.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index e1def23..419cf79 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -106,7 +106,7 @@ def get_subreddit_threads(POST_ID: str): upvotes = submission.score ratio = submission.upvote_ratio * 100 num_comments = submission.num_comments - threadurl = f"https://reddit.com{submission.permalink}" + threadurl = f"https://new.reddit.com/{submission.permalink}" print_substep(f"Video will be: {submission.title} :thumbsup:", style="bold green") print_substep(f"Thread url is: {threadurl} :thumbsup:", style="bold green") diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index cdc8d61..2ba0e52 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -75,7 +75,7 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int): print_substep("Launching Headless Browser...") browser = p.chromium.launch( - headless=True + headless=False ) # headless=False will show the browser for debugging purposes # Device scale factor (or dsf for short) allows us to increase the resolution of the screenshots # When the dsf is 1, the width of the screenshot is 600 pixels @@ -220,7 +220,7 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int): if page.locator('[data-testid="content-gate"]').is_visible(): page.locator('[data-testid="content-gate"] button').click() - page.goto(f'https://reddit.com{comment["comment_url"]}', timeout=0) + page.goto(f'https://new.reddit.com/{comment["comment_url"]}', timeout=0) # translate code