alexlaverty / python-reddit-youtube-bot

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

Can please help me to fix this : I run : Python app.py -l 59 #88

Open nPokemon opened 1 year ago

nPokemon commented 1 year ago

90.............102 Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 1262, in init subprocess_call(cmd, logger=None) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\tools.py", line 43, in subprocess_call raise IOError(err.decode("utf8")) OSError: magick.exe: label expected `@C:\Users\ADMINI~1\AppData\Local\Temp\tmplafqaafe.txt' @ error/annotate.c/GetMultilineTypeMetrics/799.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 370, in process_submissions(submissions) File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 65, in process_submissions process_submission(submission) File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 103, in process_submission thumbnails: List[Path] = thumbnail.generate( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\thumbnail\thumbnail.py", line 180, in generate thumbnail = create_thumbnail( ^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\thumbnail\thumbnail.py", line 333, in create_thumbnail txt_clip: TextClip = TextClip( ^^^^^^^^^ File "", line 2, in init File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 1272, in init raise IOError(error) OSError: MoviePy Error: creation of None failed because of the following error:

magick.exe: label expected `@C:\Users\ADMINI~1\AppData\Local\Temp\tmplafqaafe.txt' @ error/annotate.c/GetMultilineTypeMetrics/799. .

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary. Check the documentation.

nPokemon commented 1 year ago

Check Magick is working fine: PS C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot> magick logo: logo.gif PS C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot> magick identify logo.gif logo.gif GIF 640x480 640x480+0+0 8-bit sRGB 256c 28576B 0.000u 0:00.000 PS C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot> magick logo.gif win:

nPokemon commented 1 year ago

Fixed: Change C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\config_defaults.py

IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect')

IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe')

New Error:

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 371, in process_submissions(submissions) File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 66, in process_submissions process_submission(submission) File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\app.py", line 104, in process_submission thumbnails: List[Path] = thumbnail.generate( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\thumbnail\thumbnail.py", line 180, in generate thumbnail = create_thumbnail( ^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\Reddit2YTB\python-reddit-youtube-bot\thumbnail\thumbnail.py", line 235, in create_thumbnail ImageClip(image) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 891, in init if len(img.shape) == 3: # img is (now) a RGB(a) numpy array ^^^^^^^^^ AttributeError: 'WindowsPath' object has no attribute 'shape'

alexlaverty commented 6 months ago

Try using an older version of python :

root@5c66bb6bd001:/app# python3 --version
Python 3.10.6