From 8e58cd67ecac665754aab105aa911324b769ba06 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 28 May 2023 14:28:25 +0200 Subject: [PATCH] Little fix --- utils/subreddit.py | 2 ++ video_creation/final_video.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/subreddit.py b/utils/subreddit.py index 43b5d1d..f9a2f0b 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -70,6 +70,8 @@ def get_subreddit_undone( f"Post is too long ({len(submission.selftext)}), try with a different post. ({settings.config['settings']['storymode_max_length']} character limit)" ) continue + elif len(submission.selftext) < 30: + continue if settings.config["settings"]["storymode"] and not submission.is_self: continue if similarity_scores is not None: diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 970d380..f57cd88 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -142,7 +142,7 @@ def make_final_video( # settings values W: Final[int] = int(settings.config["settings"]["resolution_w"]) H: Final[int] = int(settings.config["settings"]["resolution_h"]) - """Fixed to allow fraction opacity Ea: 0.7""" + opacity = settings.config["settings"]["opacity"] reddit_id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) @@ -156,7 +156,7 @@ def make_final_video( # Gather all audio clips audio_clips = list() - if number_of_clips == 0: + if number_of_clips == 0 and settings.config["settings"]["storymode"] == "false": print("No audio clips to gather. Please use a different TTS or post.") # This is to fix the TypeError: unsupported operand type(s) for +: 'int' and 'NoneType' exit() if settings.config["settings"]["storymode"]: @@ -347,6 +347,7 @@ def make_final_video( fontcolor="White", fontfile=os.path.join("fonts", "Roboto-Regular.ttf"), ) + background_clip = background_clip.filter("scale", W, H) print_step("Rendering the video 🎥") from tqdm import tqdm