diff --git a/README.md b/README.md index 606b7db..5c2d886 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ The only original thing being done is the editing and gathering of all materials 6. Run `python3 main.py` 7. Enjoy 😎 +## Video +https://user-images.githubusercontent.com/19284904/172727335-7e11c816-3484-4033-a535-4b061751fa3b.mp4 + + ## Contributing & Ways to improve 📈 In its current state, this bot does exactly what it needs to do. However, lots of improvements can be made. diff --git a/utils/subreddit.py b/utils/subreddit.py index 3fc1613..7a7dca0 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -1,6 +1,7 @@ from typing import List import json - +from os import getenv +from utils.console import print_substep def get_subreddit_undone(submissions: List, subreddit): """ @@ -11,6 +12,10 @@ def get_subreddit_undone(submissions: List, subreddit): for submission in submissions: if already_done(done_videos, submission): continue + if submission.over_18: + if getenv("ALLOW_NSFW").casefold() == "false": + print_substep("NSFW Post Detected. Skipping...") + continue return submission return get_subreddit_undone( subreddit.top(time_filter="hour"), subreddit diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index 89d6728..d401811 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -42,12 +42,6 @@ def download_screenshots_of_reddit_posts(reddit_object, screenshot_num): if page.locator('[data-testid="content-gate"]').is_visible(): # This means the post is NSFW and requires to click the proceed button. - if getenv("ALLOW_NSFW").casefold() == "false": - print_substep("NSFW Post Detected. Skipping...") - from main import main - - main() - print_substep("Post is NSFW. You are spicy... :fire:") page.locator('[data-testid="content-gate"] button').click()