alexlaverty / python-reddit-youtube-bot

Automated Reddit Youtube Video Bot
https://www.youtube.com/channel/UCzIwW92D_rM5_yvWBsquSbw
78 stars 17 forks source link

Error at the end of app.py #50

Closed WillyBoy1900 closed 1 year ago

WillyBoy1900 commented 1 year ago

I'm getting this weird error when I run app.py on command prompt. The error I'm getting is because of moviepy but I don't know why its happening. Thanks for all the help.

2022-11-18 20:20:28 INFO     Created Audio File : assets\work_dir\yyj285\selftext_0.mp3
Traceback (most recent call last):
  File "C:\Users\will\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 285, in ffmpeg_parse_infos
    line = [l for l in lines if keyword in l][index]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\will\Downloads\ttsvibelounge-main\app.py", line 321, in <module>
    process_submissions(submissions)
  File "c:\Users\will\Downloads\ttsvibelounge-main\app.py", line 49, in process_submissions
    process_submission(submission)
  File "c:\Users\will\Downloads\ttsvibelounge-main\app.py", line 92, in process_submission
    vid.create(video_directory=video.folder_path,
  File "c:\Users\will\Downloads\ttsvibelounge-main\video_generation\video.py", line 245, in create
    selftext_audioclip = AudioFileClip(selftext_audio_filepath)
  File "C:\Users\will\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 70, in __init__
    self.reader = FFMPEG_AudioReader(filename, fps=fps, nbytes=nbytes,
  File "C:\Users\will\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\audio\io\readers.py", line 51, in __init__
    infos = ffmpeg_parse_infos(filename)
  File "C:\Users\will\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 289, in ffmpeg_parse_infos
    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"
OSError: MoviePy error: failed to read the duration of file assets\work_dir\yyj285\selftext_0.mp3.
Here are the file infos returned by ffmpeg:

able-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enab --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libt--enablwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzima --enaable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb g --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa -able-lienable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d1nvdec --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc -1va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mp3 @ 000001a896c58d00] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 000001a896c58d00] Failed to read frame size: Could not seek to 1026.
assets\work_dir\yyj285\selftext_0.mp3: Invalid argument
alexlaverty commented 1 year ago

Most likely a weird character in the SelfText it's trying to process, if you can send me the URL to the Reddit post you were trying to process I can have a look.

WillyBoy1900 commented 1 year ago

Ya I don't know what happened but it randomly started working Thank You Though.