Files
RedditVideoMakerBot/utils/subreddit.py
T
PatatjeMC 3be00d00d7 Changed to tts chunk combiner to sox
This helps performance and improves audio quality as movie.py adds a lot of audio glitches also there where a few small mistakes in the old version that I fixed and seem to work.
2022-06-08 20:48:50 +02:00

21 lines
705 B
Python

from typing import List
import json
def get_hottest_undone(submissions: List):
"""
recursively checks if the top submission in the list was already done.
"""
with open("./video_creation/data/videos.json", "r") as done_vids_raw:
done_videos = json.load(done_vids_raw)
for submission in submissions:
if already_done(done_videos, submission):
continue
return submission
return get_subreddit_undone(subreddit.top(time_filter="hour")) # all of the videos in hot have already been done
def already_done(done_videos: list, submission):
for video in done_videos:
if video["id"] == str(submission):
return True
return False