elebumm / RedditVideoMakerBot

Create Reddit Videos with just✨ one command ✨
GNU General Public License v3.0
6.66k stars 1.86k forks source link

[Bug]: OSError: [Errno 32] Broken pipe OSError: [Errno 22] Invalid argument #2119

Closed g-hano closed 2 months ago

g-hano commented 2 months ago

Describe the bug

when I run main.py, I get Errno 32 and 22 errors.

Reproduction Steps

Just ran the code

Expected behavior

to write audio in ./assets/temp{id}/background.mp3

Screenshots

ss0 ss1

System Information

Operating System : Windows 10 Python version : 3.11.3

Checklist

Additional Context

╭────────────────────────────────────────────────────────────────────────────────────────────────│ You are using the newest version (3.3.0) of the bot ╰────────────────────────────────────────────────────────────────────────────────────────────────###############################

Checking TOML configuration

############################### If you see any prompts, that means that you have unset/incorrectly set variables, please input th ╭────────────────────────────────────────────────────────────────────────────────────────────────│ on the 1st iteration of 1 ╰────────────────────────────────────────────────────────────────────────────────────────────────Logging into Reddit. ╭────────────────────────────────────────────────────────────────────────────────────────────────│ Getting subreddit threads... ╰────────────────────────────────────────────────────────────────────────────────────────────────Using subreddit: r/AskReddit from TOML config Video will be: What’s the worst physical pain you’ve ever felt? 👍 Thread url is: https://new.reddit.com//r/AskReddit/comments/1equtrl/whats_the_worst_physical_pain Thread has 4293 upvotes Thread has a upvote ratio of 92.0% Thread has 12012 comments Received subreddit threads Successfully. Thread ID is 1equtrl ╭────────────────────────────────────────────────────────────────────────────────────────────────│ Saving Text to MP3 files... ╰────────────────────────────────────────────────────────────────────────────────────────────────Saving... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.8 it/s
Saved Text to MP3 files successfully. ╭────────────────────────────────────────────────────────────────────────────────────────────────│ Downloading screenshots of reddit posts... ╰────────────────────────────────────────────────────────────────────────────────────────────────Launching Headless Browser... Logging in to Reddit... Skipping translation... Downloading screenshots... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:22 Screenshots downloaded Successfully. ╭────────────────────────────────────────────────────────────────────────────────────────────────│ Finding a spot in the backgrounds audio to chop...✂️ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────MoviePy - Writing audio in RedditVideoMakerBot/assets/temp/1equtrl/background.mp3 chunk: 0%| ───────────────────────────────────────────────────────────────────────────────────────────────── │ Sorry, something went wrong with this version! Try again, and feel free to report this issue at│ Version: 3.3.0 │ Error: [Errno 32] Broken pipe │ │ MoviePy error: FFMPEG encountered the following error while writing file RedditVideoMakerBot/as│ │ b'RedditVideoMakerBot/assets/temp/1equtrl/background.mp3: No such file or directory\r\n' │ │ In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubunt│ Config: {'allow_nsfw': False, 'theme': 'dark', 'times_to_run': 1, 'opacity': 0.9, 'storymode': │ 'resolution_w': 1080, 'resolution_h': 1920, 'zoom': 1.0, 'channel_name': 'Reddit Tales', 'backg│ 'background_audio_volume': 0.15, 'enable_extra_audio': False, 'background_thumbnail': False, 'b│ 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, 'tts':│ 'elevenlabs_voice_name': 'Bella', 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': 'Matthew│ 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0╰────────────────────────────────────────────────────────────────────────────────────────────────Traceback (most recent call last): File "C:\Users\Cihan\Desktop\merge\merge\Lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter. self.proc.stdin.write(frames_array.tobytes()) BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\Cihan\Desktop\merge\RedditVideoMakerBot\main.py", line 131, in raise err File "c:\Users\Cihan\Desktop\merge\RedditVideoMakerBot\main.py", line 113, in run_many(config["settings"]["times_to_run"]) File "c:\Users\Cihan\Desktop\merge\RedditVideoMakerBot\main.py", line 68, in run_many main() File "c:\Users\Cihan\Desktop\merge\RedditVideoMakerBot\main.py", line 59, in main chop_background(bg_config, length, reddit_object) File "c:\Users\Cihan\Desktop\merge\RedditVideoMakerBot\video_creation\background.py", line 143, background_audio.write_audiofile(f"RedditVideoMakerBot/assets/temp/{id}/background.mp3") return f(clip, *a, **k) ^^^^^^^^^^^^^^^^ File "C:\Users\Cihan\Desktop\merge\merge\Lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 170, in ffmpeg_audiowrite writer.write_frames(chunk) File "C:\Users\Cihan\Desktop\merge\merge\Lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 117, in write_frames raise IOError(error) OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file RedditVideoMakerBot/assets/temp/1equtrl/background.mp3:

b'RedditVideoMakerBot/assets/temp/1equtrl/background.mp3: No such file or directory\r\n'

In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubuntu/Debian repos are deprecated). Exception ignored in: <function FFMPEG_AudioWriter.del at 0x0000016ADA138EA0> Traceback (most recent call last): File "C:\Users\Cihan\Desktop\merge\merge\Lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 132, in del self.close() File "C:\Users\Cihan\Desktop\merge\merge\Lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 121, in close self.proc.stdin.close() OSError: [Errno 22] Invalid argument

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment, or this will be closed in 10 days.

github-actions[bot] commented 2 months ago

Issue closed due to being stale. Please reopen if issue persists in latest version.