From dd19a79ecd7b3f6d225e2549af3ce2c2e11e5690 Mon Sep 17 00:00:00 2001 From: Drugsosos <44712637+Drugsosos@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:21:38 +0300 Subject: [PATCH] little fixes --- main.py | 2 +- video_creation/final_video.py | 8 ++++---- video_creation/screenshot_downloader.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index b563636..b2d4449 100755 --- a/main.py +++ b/main.py @@ -37,7 +37,7 @@ async def main(POST_ID=None): cleanup() reddit_object = get_subreddit_threads(POST_ID) comments_created = await save_text_to_mp3(reddit_object) - download_screenshots_of_reddit_posts(reddit_object, comments_created) + await download_screenshots_of_reddit_posts(reddit_object, comments_created) bg_config = get_background_config() make_final_video(comments_created, reddit_object, bg_config) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index c46adba..c4580e9 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -137,13 +137,13 @@ def make_final_video( ) ) - for photo_idx in indexes_for_videos: + for idx, photo_idx in enumerate(indexes_for_videos): image_clips.append( create_image_clip( f'comment_{photo_idx}', - audio_clips[photo_idx].start, - audio_clips[photo_idx].end, - audio_clips[photo_idx].duration + audio_clips[idx + 1].start, + audio_clips[idx + 1].end, + audio_clips[idx + 1].duration ) ) diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index a277cf2..6ceff45 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -74,7 +74,7 @@ async def download_screenshots_of_reddit_posts(reddit_object: dict, voiced_idx: ) else: for idx in track( - screenshot_num, + voiced_idx, "Downloading screenshots..." ): comment = reddit_object["comments"][idx]