Refactored for easier merging and fixed dependencies.

pull/157/head
Lewis Menelaws 3 years ago
parent b05ac18476
commit 45e3a11440

@ -1,6 +1,6 @@
from utils.console import print_markdown from utils.console import print_markdown
import time import time
from reddit.askreddit import get_askreddit_threads from reddit.subreddit import get_askreddit_threads
from video_creation.background import download_background, chop_background_video from video_creation.background import download_background, chop_background_video
from video_creation.voices import save_text_to_mp3 from video_creation.voices import save_text_to_mp3
from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts

@ -13,13 +13,15 @@ def get_askreddit_threads():
load_dotenv() load_dotenv()
print_step("Getting AskReddit threads...") print_step("Getting AskReddit threads...")
print(os.getenv("REDDIT_2FA"))
if os.getenv("REDDIT_2FA") == "yes" or "YES": if os.getenv("REDDIT_2FA").lower() == "yes":
print("\nEnter your two-factor authentication code from your authenticator app.\n") print(
"\nEnter your two-factor authentication code from your authenticator app.\n"
)
code = input("> ") code = input("> ")
print() print()
pw = os.getenv("REDDIT_PASSWORD") pw = os.getenv("REDDIT_PASSWORD")
passkey = f'{pw}:{code}' passkey = f"{pw}:{code}"
else: else:
passkey = os.getenv("REDDIT_PASSWORD") passkey = os.getenv("REDDIT_PASSWORD")

@ -15,7 +15,7 @@ mccabe==0.6.1
moviepy==1.0.3 moviepy==1.0.3
mutagen==1.45.1 mutagen==1.45.1
mypy-extensions==0.4.3 mypy-extensions==0.4.3
numpy==1.15.1 numpy==1.22.3
pathspec==0.8.0 pathspec==0.8.0
Pillow==9.1.1 Pillow==9.1.1
playwright==1.22.0 playwright==1.22.0

@ -25,8 +25,8 @@ def download_background():
print_substep("Downloading the background video... please be patient.") print_substep("Downloading the background video... please be patient.")
ydl_opts = { ydl_opts = {
'outtmpl': 'assets/mp4/background', "outtmpl": "assets/mp4/background.mp4",
'merge_output_format': 'mp4', "merge_output_format": "mp4",
} }
with YoutubeDL(ydl_opts) as ydl: with YoutubeDL(ydl_opts) as ydl:

Loading…
Cancel
Save