Merge pull request #74 from PatatjeMC/master

Better anti NSFW
This commit is contained in:
Jason authored and GitHub committed 2022-06-09 11:39:44 -04:00
commit 77f5ae98d5
2 files changed
+6 -7

No files matched your search

+6 -1
View File
@@ -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
-6
View File
@@ -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()