fixed the typehiting that @HallowedDust5 broke for py versions < 3.9
This commit is contained in:
1 parent
89f4644ce9
commit
90be9e09b3
4 files changed
+12
-7
No files matched your search
+4
-3
@@ -2,6 +2,7 @@ import json
|
||||
import os
|
||||
import time
|
||||
from os import getenv
|
||||
from typing import Dict
|
||||
|
||||
from praw.models import Submission
|
||||
|
||||
@@ -9,16 +10,16 @@ from utils.console import print_step
|
||||
|
||||
|
||||
def check_done(
|
||||
redditobj: dict[str],
|
||||
redditobj: Dict[str],
|
||||
) -> Submission:
|
||||
# don't set this to be run anyplace that isn't subreddit.py bc of inspect stack
|
||||
"""Checks if the chosen post has already been generated
|
||||
|
||||
Args:
|
||||
redditobj (dict[str]): Reddit object gotten from reddit/subreddit.py
|
||||
redditobj (Dict[str]): Reddit object gotten from reddit/subreddit.py
|
||||
|
||||
Returns:
|
||||
dict[str]|None: Reddit object in args
|
||||
Dict[str]|None: Reddit object in args
|
||||
"""
|
||||
|
||||
with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw:
|
||||
|
||||
@@ -3,6 +3,7 @@ import multiprocessing
|
||||
import os
|
||||
import re
|
||||
from os.path import exists
|
||||
from typing import Dict
|
||||
|
||||
from moviepy.editor import (
|
||||
VideoFileClip,
|
||||
@@ -25,12 +26,13 @@ console = Console()
|
||||
W, H = 1080, 1920
|
||||
|
||||
|
||||
def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str]):
|
||||
def make_final_video(number_of_clips: int, length: int, reddit_obj: Dict[str]):
|
||||
"""Gathers audio clips, gathers all screenshots, stitches them together and saves the final video to assets/temp
|
||||
|
||||
Args:
|
||||
number_of_clips (int): Index to end at when going through the screenshots
|
||||
length (int): Length of the video
|
||||
reddit_obj (Dict[str]): The reddit object that contains the posts to read.
|
||||
"""
|
||||
print_step("Creating the final video 🎥")
|
||||
VideoFileClip.reW = lambda clip: clip.resize(width=W)
|
||||
|
||||
@@ -2,6 +2,7 @@ import json
|
||||
import os
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from playwright.async_api import async_playwright # pylint: disable=unused-import
|
||||
|
||||
@@ -16,11 +17,11 @@ from utils.console import print_step, print_substep
|
||||
storymode = False
|
||||
|
||||
|
||||
def download_screenshots_of_reddit_posts(reddit_object: dict[str], screenshot_num: int):
|
||||
def download_screenshots_of_reddit_posts(reddit_object: Dict[str], screenshot_num: int):
|
||||
"""Downloads screenshots of reddit posts as seen on the web. Downloads to assets/temp/png
|
||||
|
||||
Args:
|
||||
reddit_object (dict[str]): Reddit object received from reddit/subreddit.py
|
||||
reddit_object (Dict[str]): Reddit object received from reddit/subreddit.py
|
||||
screenshot_num (int): Number of screenshots to downlaod
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from typing import Dict, Tuple
|
||||
|
||||
from rich.console import Console
|
||||
|
||||
@@ -23,7 +24,7 @@ TTSProviders = {
|
||||
}
|
||||
|
||||
|
||||
def save_text_to_mp3(reddit_obj: dict[str]) -> tuple[int, int]:
|
||||
def save_text_to_mp3(reddit_obj: Dict[str]) -> Tuple[int, int]:
|
||||
"""Saves text to MP3 files.
|
||||
|
||||
Args:
|
||||
|
||||
Reference in new issue
Block a user