Files
RedditVideoMakerBot/utils/videos.py
T
PatatjeMC f67aefabfd Fixed some bugs and upped background resolution
Fixed the 2 most common errors that I encountered:
 - The "SoX error" (That's what it's called in JasonLovesDoggo's repo)
 - AttributeError: 'dict' object has no attribute 'title'

Fixed the ending being glitchy and freezing

Upped the resolution of the background cause it looked bad
2022-06-05 16:47:29 +02:00

22 lines
812 B
Python
Executable File

import inspect
import json
from os import getenv
from utils.console import print_step
def check_done(redditobj): # don't set this to be run anyplace that isn't subreddit.py bc of inspect stack
"""params:
reddit_object: The Reddit Object you received in askreddit.py"""
if getenv('POST_ID'):
print_step(
'You already have done this video but since it was declared specifically in the .env file the program will continue')
return redditobj
with open('./video_creation/data/videos.json', 'r') as done_vids_raw:
done_videos = json.load(done_vids_raw)
for video in done_videos:
if video['id'] == str(redditobj):
print_step('Getting new post as the current one has already been done')
return None
return redditobj