TraySimpson / RedditVideoGenerator

334 stars 135 forks source link

Can u help me with the code? #8

Closed Jakob42069 closed 1 year ago

Jakob42069 commented 1 year ago

I allways get this error and I dont quite understand what i have to change. This is the output when i run main.py: C:\Users\user\AppData\Local\Programs\Python\Python311\python.exe C:\Users\user\Downloads\RedditVideoGenerator-master\main.py [0] What movies come to mind when you think of great soundtracks? 1364 14.9 hours ago [1] What's an American tradition you actually love? 475 17.7 hours ago [2] What’s the first sign that a movie is going to be bad? 1612 6.0 hours ago [3] What is something you hope to witness in your lifetime? 263 12.5 hours ago Input: 2 Traceback (most recent call last): File "C:\Users\user\Downloads\RedditVideoGenerator-master\main.py", line 87, in createVideo() File "C:\Users\user\Downloads\RedditVideoGenerator-master\main.py", line 17, in createVideo script = reddit.getContent(outputDir, postOptionCount) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\RedditVideoGenerator-master\reddit.py", line 35, in getContent return getContentFromPost(selectedPost) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\RedditVideoGenerator-master\reddit.py", line 62, in getContentFromPost content = VideoScript(submission.url, submission.title, submission.id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\RedditVideoGenerator-master\videoscript.py", line 22, in init self.titleAudioClip = self.createVoiceOver("title", title) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\Downloads\RedditVideoGenerator-master\videoscript.py", line 48, in createVoiceOver audioClip = AudioFileClip(file_path) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 70, in init self.reader = FFMPEG_AudioReader(filename, fps=fps, nbytes=nbytes, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\audio\io\readers.py", line 51, in init infos = ffmpeg_parse_infos(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 270, in ffmpeg_parse_infos raise IOError(("MoviePy error: the file %s could not be found!\n" OSError: MoviePy error: the file Voiceovers/2023-04-02-129k7ok-title.mp3 could not be found! Please check that you entered the correct path.

Process finished with exit code 1

cryptotypebeat commented 1 year ago

im where you are rn... it seems like we need to create folders in the directory: OutputVideos, ScreenShots, Voiceovers, BackgroundVideos... i still get an error except my terminal now is like this:

[0] What’s the first sign that a movie is going to be bad? 8796 10.2 hours ago [1] What movies come to mind when you think of great soundtracks? 1742 19.1 hours ago [2] If there is ice cream in Zootopia, who is getting milked? Do mammals only eat ice cream produced with their own milk? 1126 11.0 hours ago [3] What's an American tradition you actually love? 582 21.9 hours ago Input :3
Creating video for post: What's an American tradition you actually love? Url: https://www.reddit.com/r/AskReddit/comments/12953pk/whats_an_american_tradition_you_actually_love/ Taking screenshots... Traceback (most recent call last): File "/Users/mikes/Desktop/RedditVideoGenerator-master/main.py", line 87, in createVideo() File "/Users/mikes/Desktop/RedditVideoGenerator-master/main.py", line 28, in createVideo backgroundVideo = VideoFileClip( ^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in init self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in init infos = ffmpeg_parse_infos(filename, print_infos, check_duration, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/moviepy/video/io/ffmpeg_reader.py", line 270, in ffmpeg_parse_infos raise IOError(("MoviePy error: the file %s could not be found!\n" OSError: MoviePy error: the file BackgroundVideos/ShortTemplate_2.mp4 could not be found! Please check that you entered the correct path.

biffotmc commented 1 year ago

Just create the folders Voiceovers and Screenshots and then everything will work fine

KiwontaTv commented 1 year ago

OSError: MoviePy error: the file BackgroundVideos/ShortTemplate_2.mp4 could not be found!

There's your problem. You dont have the background videos

Delafinn commented 1 year ago

@cryptotypebeat you have to name the background videos: ShortTemplate_1,ShortTemplate_2, etc in the background videos directory.

khutmanan7 commented 1 year ago

Traceback (most recent call last): File "/Users/khutmanan/Desktop/RedditVideoGenerator/main.py", line 87, in createVideo() File "/Users/khutmanan/Desktop/RedditVideoGenerator/main.py", line 17, in createVideo script = reddit.getContent(outputDir, postOptionCount) File "/Users/khutmanan/Desktop/RedditVideoGenerator/reddit.py", line 28, in getContent return getContentFromPost(selectedPost) File "/Users/khutmanan/Desktop/RedditVideoGenerator/reddit.py", line 56, in getContentFromPost content = VideoScript(submission.url, submission.title, submission.id) File "/Users/khutmanan/Desktop/RedditVideoGenerator/videoscript.py", line 22, in init self.titleAudioClip = self.createVoiceOver("title", title) File "/Users/khutmanan/Desktop/RedditVideoGenerator/videoscript.py", line 48, in createVoiceOver audioClip = AudioFileClip(file_path) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/moviepy/audio/io/AudioFileClip.py", line 70, in init self.reader = FFMPEG_AudioReader(filename, fps=fps, nbytes=nbytes, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/moviepy/audio/io/readers.py", line 51, in init infos = ffmpeg_parse_infos(filename) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 270, in ffmpeg_parse_infos raise IOError(("MoviePy error: the file %s could not be found!\n" OSError: MoviePy error: the file /Users/khutmanan/Desktop/RedditVideoGenerator/Voiceovers/2023-04-04-12b21fs-title.mp3 could not be found! Please check that you entered the correct path.

I already created the Folder but still error can anyone help me? thanks