diff --git a/.gitignore b/.gitignore index c1074a1..2201ee0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ assets/ .env reddit-bot-351418-5560ebc49cac.json /.idea +*.pyc diff --git a/reddit/askreddit.py b/reddit/askreddit.py index ad9cfa0..c11791c 100644 --- a/reddit/askreddit.py +++ b/reddit/askreddit.py @@ -1,4 +1,4 @@ -from utils.console import print_markdown, print_step, print_substep +from utils.console import print_step, print_substep import praw import random from dotenv import load_dotenv diff --git a/reddit/subreddit.py b/reddit/subreddit.py index ba9e97c..25f5d48 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -42,6 +42,8 @@ def get_subreddit_threads(): threads = subreddit.hot(limit=25) submission = list(threads)[random.randrange(0, 25)] + print_substep(f'subreddit thread is: {submission.title}\n(if you dont like this, you can change it by exiting and rerunning the program)') + os.environ["VIDEO_TITLE"] = str(ascifi(submission.title)) try: diff --git a/requirements.txt b/requirements.txt index da87ca9..3589ada 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,42 +1,8 @@ -appdirs==1.4.4 -black==20.8b1 -certifi==2021.10.8 -charset-normalizer==2.0.12 -click==7.1.2 -commonmark==0.9.1 -decorator==4.4.2 -flake8==3.8.3 -greenlet==1.1.2 -gTTS==2.2.4 -idna==3.3 -imageio==2.19.2 -imageio-ffmpeg==0.4.7 -mccabe==0.6.1 -moviepy==1.0.3 -mutagen==1.45.1 -mypy-extensions==0.4.3 -numpy==1.22.3 -pathspec==0.8.0 -Pillow==9.1.1 -playwright==1.22.0 -praw==7.6.0 -prawcore==2.3.0 -proglog==0.1.10 -pycodestyle==2.6.0 -pyee==8.1.0 -pyflakes==2.2.0 -Pygments==2.12.0 +praw~=7.6.0 +moviepy~=1.0.3 +rich~=12.4.4 +gTTS~=2.2.4 +mutagen~=1.45.1 +pytube~=12.1.0 +playwright~=1.22.0 python-dotenv==0.20.0 -pytube==12.1.0 -regex==2020.10.15 -requests==2.27.1 -rich==12.4.4 -six==1.16.0 -toml==0.10.1 -tqdm==4.64.0 -typed-ast==1.4.1 -typing_extensions==4.2.0 -update-checker==0.18.0 -urllib3==1.26.9 -websocket-client==1.3.2 -websockets==10.1 diff --git a/video_creation/background.py b/video_creation/background.py index e866c85..ac276b0 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -5,7 +5,7 @@ from random import randrange from pytube import YouTube from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from moviepy.editor import VideoFileClip -from rich.progress import track, Progress +from rich.progress import Progress from utils.console import print_step, print_substep @@ -24,8 +24,8 @@ def download_background(): Path("./assets/backgrounds/").mkdir(parents=True, exist_ok=True) background_options = [ # uri , filename , credit ("https://www.youtube.com/watch?v=n_Dv4JMiwK8", "parkour.mp4", 'bbswitzer'), - # note: make sure the file name doesn't include a - in it ("https://www.youtube.com/watch?v=2X9QGY__0II", "rocket_league.mp4", 'Orbital Gameplay'), ] + # note: make sure the file name doesn't include a - in it print(listdir('./assets/backgrounds'), 'podsods', len(background_options)) if listdir('./assets/backgrounds') != len(background_options): print_step("We need to download the backgnrounds videos. they are fairly large but it's only done once. 😎") diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 877d66a..f125b28 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -50,4 +50,4 @@ def make_final_video(number_of_clips): cleanups = cleanup() print_substep(f"Removed {cleanups} temporary files 🗑") - print_step(f"Reddit title: {os.getenv('VIDEO_TITLE')} | Background Credit {os.getenv('background_credit')}") + print_step(f"Reddit title: {os.getenv('VIDEO_TITLE')} \n Background Credit: {os.getenv('background_credit')}")