From 839eb6fc2ffc08149145fdc800fbd0f87fa5128d Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 14 Jul 2022 19:36:35 -0400 Subject: [PATCH] added a potential bypass in case of absolute mad lads --- utils/subreddit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/subreddit.py b/utils/subreddit.py index 4eb0108..5638f1e 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -5,7 +5,7 @@ from utils import settings from utils.console import print_substep -def get_subreddit_undone(submissions: list, subreddit): +def get_subreddit_undone(submissions: list, subreddit, times_checked=0): """_summary_ Args: @@ -41,9 +41,13 @@ def get_subreddit_undone(submissions: list, subreddit): continue return submission print("all submissions have been done going by top submission order") + VALID_TIME_FILTERS = ["day", "hour", "month", "week", "year", 'all'] # set doesn't have __getitem__ + index = times_checked + 1 + if index == len(VALID_TIME_FILTERS): + print("all time filters have been checked you absolute madlad ") + return get_subreddit_undone( - subreddit.top(time_filter="hour"), subreddit - ) # all the videos in hot have already been done + subreddit.top(time_filter=VALID_TIME_FILTERS[index], limit=(50 if int(index) == 0 else index+1 * 50)), subreddit, times_checked=index) # all the videos in hot have already been done def already_done(done_videos: list, submission) -> bool: