diff --git a/main.py b/main.py index 4d55e67..cfa903d 100755 --- a/main.py +++ b/main.py @@ -66,7 +66,7 @@ def main(POST_ID=None) -> None: def run_many(times) -> None: for x in range(1, times + 1): print_step( - f'on the {x}{("th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th")[x % 10]} iteration of {times}' + f'{x}{("th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th")[x % 10]} iteration of {times}' ) # correct 1st 2nd 3rd 4th 5th.... main() # Popen("cls" if name == "nt" else "clear", shell=True).wait() @@ -108,7 +108,7 @@ if __name__ == "__main__": for index, post_id in enumerate(config["reddit"]["thread"]["post_id"].split("+")): index += 1 print_step( - f'on the {index}{("st" if index % 10 == 1 else ("nd" if index % 10 == 2 else ("rd" if index % 10 == 3 else "th")))} post of {len(config["reddit"]["thread"]["post_id"].split("+"))}' + f'{index}{("st" if index % 10 == 1 else ("nd" if index % 10 == 2 else ("rd" if index % 10 == 3 else "th")))} post of {len(config["reddit"]["thread"]["post_id"].split("+"))}' ) main(post_id) # Popen("cls" if name == "nt" else "clear", shell=True).wait() diff --git a/reddit/subreddit.py b/reddit/subreddit.py index efb1a7c..fdaa3d6 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -124,6 +124,7 @@ def get_subreddit_threads(POST_ID: str): content["thread_title"] = submission.title content["thread_id"] = submission.id content["is_nsfw"] = submission.over_18 + content['subreddit'] = str(submission.subreddit) content["comments"] = [] if settings.config["settings"]["storymode"]: ai_selftext = submission.selftext diff --git a/requirements.txt b/requirements.txt index d10b8d3..9c7893b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ botocore==1.29.142 gTTS==2.3.2 moviepy==1.0.3 playwright==1.34.0 -praw==7.7.0 +praw==7.7.1 prawcore~=2.3.0 requests==2.31.0 rich==13.4.1 diff --git a/run.sh b/run.sh index 6010ab7..a14ef99 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,3 @@ #!/bin/sh -sudo docker run -v $(pwd)/config.toml:/app/config.toml -v $(pwd)/out/:/app/assets -v $(pwd)/.env:/app/.env -v $(pwd)/results:/app/results -it rvmt +sudo docker run -v $(pwd)/video_creation/data:/app/video_creation/data -v $(pwd)/config.toml:/app/config.toml -v $(pwd)/out/:/app/assets -v $(pwd)/.env:/app/.env -v $(pwd)/results:/app/results -it rvmt diff --git a/video_creation/data/videos.json b/video_creation/data/videos.json index fe51488..0637a08 100644 --- a/video_creation/data/videos.json +++ b/video_creation/data/videos.json @@ -1 +1 @@ -[] +[] \ No newline at end of file diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 048bd20..72be008 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -262,14 +262,14 @@ def make_final_video( title_thumb = reddit_obj["thread_title"] filename = f"{name_normalize(title)[:251]}" - subreddit = settings.config["reddit"]["thread"]["subreddit"] + subreddit = reddit_obj['subreddit'] # settings.config["reddit"]["thread"]["subreddit"] if not exists(f"./results/{subreddit}"): - print_substep("The 'results' folder could not be found so it was automatically created.") + # print_substep("The 'results' folder could not be found so it was automatically created.") os.makedirs(f"./results/{subreddit}") if not exists(f"./results/{subreddit}/OnlyTTS") and allowOnlyTTSFolder: - print_substep("The 'OnlyTTS' folder could not be found so it was automatically created.") + # print_substep("The 'OnlyTTS' folder could not be found so it was automatically created.") os.makedirs(f"./results/{subreddit}/OnlyTTS") # create a thumbnail for the video @@ -277,9 +277,9 @@ def make_final_video( if settingsbackground["background_thumbnail"]: if not exists(f"./results/{subreddit}/thumbnails"): - print_substep( - "The 'results/thumbnails' folder could not be found so it was automatically created." - ) + # print_substep( + # "The 'results/thumbnails' folder could not be found so it was automatically created." + # ) os.makedirs(f"./results/{subreddit}/thumbnails") # get the first file with the .png extension from assets/backgrounds and use it as a background for the thumbnail first_image = next(