improvements

pull/280/head
iaacornus 3 years ago
parent d6c7287630
commit 231a3497f5
No known key found for this signature in database
GPG Key ID: 281739AE7252598C

@ -9,7 +9,6 @@ from utils.console import print_step, print_substep
def get_subreddit_threads(subreddit_):
global submission
"""
Takes subreddit_ as parameter which defaults to None, but in this
case since it is None, it would raise ValueError, thus defaulting
@ -18,6 +17,7 @@ def get_subreddit_threads(subreddit_):
Returns a list of threads from the AskReddit subreddit.
"""
global submission
load_dotenv()
print_step("Getting AskReddit threads...")

@ -19,14 +19,14 @@ def download_screenshots_of_reddit_posts(reddit_object, screenshot_num, theme):
# ! Make sure the reddit screenshots folder exists
Path("assets/png").mkdir(parents=True, exist_ok=True)
with sync_playwright() as p:
with sync_playwright() as browser_:
print_substep("Launching Headless Browser...")
browser = p.chromium.launch()
browser = browser_.chromium.launch()
context = browser.new_context()
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)
context.add_cookies(cookies)

Loading…
Cancel
Save