GithubHelp home page GithubHelp logo

fujiwarachoki / moneyprinter Goto Github PK

View Code? Open in Web Editor NEW
9.7K 70.0 1.3K 223 KB

Automate Creation of YouTube Shorts using MoviePy.

License: MIT License

Python 75.35% HTML 14.80% Dockerfile 1.23% JavaScript 8.63%
automation chatgpt moviepy python

moneyprinter's Introduction

MoneyPrinter πŸ’Έ

Automate the creation of YouTube Shorts, simply by providing a video topic to talk about.

Important Please make sure you look through existing/closed issues before opening your own. If it's just a question, please join our discord and ask there.

πŸŽ₯ Watch the video on YouTube.

There are two ways to use MoneyPrinter, either:

Check out the instructions for the local version here. If you want to use the hosted version, please visit Rhea.

FAQ πŸ€”

How do I get the TikTok session ID?

You can obtain your TikTok session ID by logging into TikTok in your browser and copying the value of the sessionid cookie.

My ImageMagick binary is not being detected

Make sure you set your path to the ImageMagick binary correctly in the .env file, it should look something like this:

IMAGEMAGICK_BINARY="C:\\Program Files\\ImageMagick-7.1.0-Q16\\magick.exe"

Don't forget to use double backslashes (\\) in the path, instead of one.

I can't install playsound: Wheel failed to build

If you're having trouble installing playsound, you can try installing it using the following command:

pip install -U wheel
pip install -U playsound

If you were not able to find your solution, please ask in the discord or create a new issue, so that the community can help you.

Donate 🎁

If you like and enjoy MoneyPrinter, and would like to donate, you can do that by clicking on the button on the right hand side of the repository. ❀️ You will have your name (and/or logo) added to this repository as a supporter as a sign of appreciation.

Contributing 🀝

Pull Requests will not be accepted for the time-being.

Star History 🌟

Star History Chart

License πŸ“

See LICENSE file for more information.

moneyprinter's People

Contributors

1noobdev avatar ahmed-hany94 avatar arne1303 avatar beautyscribbles avatar brettfraley avatar bzzz666 avatar donburgareli avatar eltociear avatar erjanmx avatar ertiti11 avatar fotiterz avatar fujiwarachoki avatar gptjozef avatar gudauu avatar istorry avatar kerta1n avatar neker97 avatar phalkmin avatar radry avatar ricardomonteirosimoes avatar ruangustavo avatar skeyelab avatar stumi01 avatar waterpheonix196 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moneyprinter's Issues

Error: RetryProvider failed

First time setting everything up, i get this error.
Am i missing packages? I have installed the requirements.txt.
But i still had to manually install a lot of packages myself before being able to run the backend.

  • python-dotenv
  • srt_equalizer
  • setuptools
  • wheel
[Video to be generated]
   Subject: Short video about marathon running
[-] Error: RetryProvider failed:
ChatgptNext: ClientResponseError: 429, message='Too Many Requests', url=URL('https://chat.fstha.com/api/openai/v1/chat/completions')
You: ClientResponseError: 403, message='Forbidden', url=URL('https://you.com/api/streamingSearch?q=%0A++++Generate+a+script+for+a+video,+depending+on+the+subject+of+the+video.%0A++++Subject:+Short+video+about+marathon+running%0A%0A++++The+script+is+to+be+returned+as+a+string.%0A%0A++++Here+is+an+example+of+a+string:%0A++++%22This+is+an+example+string.%22%0A%0A++++Do+not+under+any+circumstance+refernce+this+prompt+in+your+response.%0A%0A++++Get+straight+to+the+point,+don't+start+with+unnecessary+things+like,+%22welcome+to+this+video%22.%0A%0A++++Obviously,+the+script+should+be+related+to+the+subject+of+the+video.%0A%0A++++ONLY+RETURN+THE+RAW+SCRIPT.+DO+NOT+RETURN+ANYTHING+ELSE.%0A++++&domain=youchat&chat=')
GeekGpt: HTTPError: 521 Server Error:  for url: https://ai.fakeopen.com/v1/chat/completions
FakeGpt: ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://linux.do/t/topic/1051')
ChatgptDemoAi: ClientResponseError: 400, message='Can not decode content-encoding: brotli (br). Please install `Brotli`', url=URL('https://chat.chatgptdemo.ai/wp-json/mwai-ui/v1/chats/submit')
FreeGpt: AttributeError: 'StreamResponse' object has no attribute 'iter_content'
ChatgptDemo: ClientResponseError: 500, message='Internal Server Error', url=URL('https://chat.chatgptdemo.net/chat_api_stream')
Chatgpt4Online: MissingRequirementsError: Install "undetected_chromedriver" and "platformdirs" package
127.0.0.1 - - [04/Feb/2024 14:06:16] "POST /api/generate HTTP/1.1" 200 -

image

I need a help

When the bot trying to put subtitles Im getting error on webside is saying: Could not retrieve stock videos: module 'PIL.Image' has no attribute 'ANTIALIAS'

I found another error

here it is [+] Creating subtitles locally
[-] Error: Expected contiguous start of match or end of input at char 1400, but started at char 1735 (unmatched content: '9\n0:01:34,600 --> 0:01\nAs technology advances, new industries and roles emerge\n\n10\n0:01 --> 0:01:58,700\nFor example, the development and maintenance of AI systems require skilled professionals in fields like machine learning, data science, and software engineering.\n\nMoreover, AI can augment human capabilities and improve productivity')

[BUG] Videoclips are too short for the actual script and stop at a still image.

Describe the bug
In a video I generated most of the clips are too short and stop playing although the text/voice continues. Only after a new "paragraph" a new clip is loaded. The result is a still image until the paragraph is finished.

Expected behavior
The next clip is played when the previous one finishes instead of just stopping at a still image.

Screenshots
Sample video:
https://drive.google.com/file/d/1h_MSsMkskG3aUy775u0MRUgSiNBLQwO1/view

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox
  • Python Version 3.11

[BUG] chatgpt4online Blocked and causing error

Describe the bug
The process stoped at this step;

[*] GPT returned an unformatted response. Attempting to clean...
[-] Could not parse response.
[-] Error: the JSON object must be str, bytes or bytearray, not list
127.0.0.1 - - [08/Feb/2024 12:54:09] "POST /api/generate HTTP/1.1" 200 -

To Reproduce
Steps to reproduce the behavior:

  1. Start backend and frontend
  2. Just input a topic, then click generate
  3. Error happen

gambar

Expected behavior
No error on the process. It recently happen.

Screenshots
gambar

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Firefox
  • Python Version 3.11.7

Additional context
i tried to use some vpn but get same results

[BUG]

C:\MoneyPrinter\Backend>python main.py

  • Serving Flask app 'main'
  • Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:8080
  • Running on http://192.168.1.2:8080
    Press CTRL+C to quit
  • Restarting with stat
    Traceback (most recent call last):
    File "C:\MoneyPrinter\Backend\main.py", line 4, in
    from video import *
    File "C:\MoneyPrinter\Backend\video.py", line 9, in
    from moviepy.editor import *
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\editor.py", line 36, in
    from .video.io.VideoFileClip import VideoFileClip
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 3, in
    from moviepy.audio.io.AudioFileClip import AudioFileClip
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 3, in
    from moviepy.audio.AudioClip import AudioClip
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\audio\AudioClip.py", line 7, in
    from moviepy.audio.io.ffmpeg_audiowriter import ffmpeg_audiowrite
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 7, in
    from moviepy.config import get_setting
    File "C:\Users\PRO\AppData\Local\Programs\Python\Python310\lib\site-packages\moviepy\config.py", line 67, in
    raise IOError(
    OSError: ImageMagick binary cannot be found at

Error occurs when clicking the button "generate"

Describe the bug
Does not generate a youtube short

To Reproduce
Steps to reproduce the behavior:
pip install --upgrade setuptools
pip install --user -r requirements.txt
cp .env.example .env
cd Backend
python main.py
cd ../Frontend
python -m http.server 3000
http://localhost:3000

Screenshots
grafik

Desktop

  • OS: [Windows]
  • Browser [Firefox]
  • Python Version [3.9]

major feature change - Full-on autopilot with db / csv inputs

Hi there,

I want to create a full-on autopilot mode, that will take inputs from a .db or .csv file, rather than manually inputting them one-by-one via the frontend. Since this is a major change to the repo, just thought to ask your opinion about this if it makes sense or is even desired, and maybe any requirements you'd like to add into.

Kind regards,

[BUG] Getting Error

Describe the bug
I am getting "An Error Occurred. Please try again later" error.

To Reproduce
Steps to reproduce the behavior:

  1. Make sure backend and frontend servers are on
  2. Try to click generate

Expected behavior
work?

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows Server 2022
  • Browser : Brave
  • Python Version v3.12.0

Error: 'videos'

[-] Error: 'videos'
127.0.0.1 - - [01/Feb/2024 11:49:43] "POST /api/generate HTTP/1.1" 200 -

the directory may be missing

Final Video has no Audio

The final Video i get has anything but no audio.
Also my Scripts and for this also the videos tend to be way to long ending in 3 minute videos that will include freeze frames because the pexel videos are too short.
Anyways, Great piece of code you made, thank you very much!

EDIT: Turns out the Problem is the MacOS standard media player. With VLC Media Player it worked just finde!

[BUG]

Describe the bug
[-] Error: [WinError 32] The process cannot access the file because it is being used by another process: '../temp/d15808de-e8cd-4b30-8bd5-641cb988409b.mp3'

error: subprocess-exited-with-error when running pip install command

When I run pip install -r requirements.txt on my Windows 11 Pro machine I get an error back like this

Python version: Python 3.12.1
Pip version: pip 23.3.2

>pip install -r requirements.txt
Collecting g4f (from -r requirements.txt (line 1))
  Using cached g4f-0.2.0.9-py3-none-any.whl.metadata (43 kB)
Requirement already satisfied: wheel in c:\python312\lib\site-packages (from -r requirements.txt (line 2)) (0.42.0)
Collecting requests (from -r requirements.txt (line 3))
  Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting moviepy (from -r requirements.txt (line 4))
  Using cached moviepy-1.0.3.tar.gz (388 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting termcolor (from -r requirements.txt (line 5))
  Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
Collecting flask (from -r requirements.txt (line 6))
  Using cached flask-3.0.1-py3-none-any.whl.metadata (3.6 kB)
Collecting flask-cors (from -r requirements.txt (line 7))
  Using cached Flask_Cors-4.0.0-py2.py3-none-any.whl.metadata (5.4 kB)
Collecting playsound (from -r requirements.txt (line 8))
  Using cached playsound-1.3.0.tar.gz (7.7 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  Γ— Getting requirements to build wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Local\Temp\pip-build-env-_k5xxtt6\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Local\Temp\pip-build-env-_k5xxtt6\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Local\Temp\pip-build-env-_k5xxtt6\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\fredr.DESKTOP-DTV2HJ8\AppData\Local\Temp\pip-build-env-_k5xxtt6\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
        File "C:\Python312\Lib\inspect.py", line 1282, in getsource
          lines, lnum = getsourcelines(object)
                        ^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python312\Lib\inspect.py", line 1264, in getsourcelines
          lines, lnum = findsource(object)
                        ^^^^^^^^^^^^^^^^^^
        File "C:\Python312\Lib\inspect.py", line 1093, in findsource
          raise OSError('could not get source code')
      OSError: could not get source code
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Says Session Id is invalid even tho it's not?

{'status': 'Session ID is invalid', 'status_code': 5} [-] Error: MoviePy error: the file ../temp/abe7f184-6866-43a9-8fd0-f18c699b0e95.mp3 could not be found! Please check that you entered the correct path. 127.0.0.1 - - [01/Feb/2024 17:39:46] "POST /api/generate HTTP/1.1" 200 -

I've tried 2 session ids now and it still says it's invalid

[BUG] Could not retrieve stock videos: generate_subtitles() missing 2 required positional arguments: 'sentences' and 'audio_clips'

Describe the bug
Every time I try to generate a video it shows this error:
Could not retrieve stock videos: generate_subtitles() missing 2 required positional arguments: 'sentences' and 'audio_clips'

I'm using my local machine with ubuntu.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Linux

Additional context
I filled all the .env with all the providers but didn't work.

GPT returned an unformatted response

This error randomly happen and stoping the progress;

...
[*] GPT returned an unformatted response. Attempting to clean...
[-] Could not parse response.
[-] Error: the JSON object must be str, bytes or bytearray, not list
127.0.0.1 - - [08/Feb/2024 12:29:48] "POST /api/generate HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2024 12:30:50] "OPTIONS /api/generate HTTP/1.1" 200 -
...

[BUG] Video generation fails when creating subtitles locally.

Describe the bug
Video generation fails after MoviePy finishes. The next debug message is "Creating Subtitles Locally" and then comes an error: "Expected contiguous start of match or end of input at char 198, but started at char 483 (unmatched content: '2\n0:00:10,780 --> 0:00\nIn this video, we will explore the fascinating world of cars, from their history and evolution to their impact on society and the environment.\n\n1\n\n3\n0:00 --> 0:00:25,760\nEvolution of Cars:\n\nCars have come a long way since their invention in the late 19th century')"

The request returns an error and no output.mp4 is generated

To Reproduce
Steps to reproduce the behavior:

  1. Cloned git repository
  2. Built MagickImage from linux source and installed on Ubuntu 22.04
  3. Updated .env file per ENV.md. ImageMagick is pointed to /usr/bin/local/magick where it was installed by make install
  4. Run main.py for the backend as suggested
  5. Send a JSON request to the backend endpoint from Postman on a remote machine:

{
"videoSubject": "Cars",
"voice": "en_au_001"
}

Expected behavior
Video to be generated at ./temp/output.mp4

Observed behavior
The video clips are downloaded and audio is generated into ./temp/, but the request errors and stops before the video is composited.

[BUG] CleintConnectorCertificateError

Describe the bug
127.0.0.1 - - [07/Feb/2024 21:15:26] "POST /api/generate HTTP/1.1" 200 -
127.0.0.1 - - [07/Feb/2024 21:16:48] "OPTIONS /api/generate HTTP/1.1" 200 -
[+] Cleaned ../temp/ directory
[+] Cleaned ../subtitles/ directory
[Video to be generated]
Subject: test

FreeGpt: ClientConnectorCertificateError: Cannot connect to host s.aifree.site:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
You: ClientConnectorCertificateError: Cannot connect to host you.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
ChatgptDemoAi: ClientConnectorCertificateError: Cannot connect to host chat.chatgptdemo.ai:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
FakeGpt: ClientConnectorCertificateError: Cannot connect to host chat-shared2.zhile.io:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
ChatgptNext: ClientConnectorCertificateError: Cannot connect to host chat.fstha.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
Chatgpt4Online: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)>
ChatgptDemo: ClientConnectorCertificateError: Cannot connect to host chat.chatgptdemo.net:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
Gpt6: ClientConnectorCertificateError: Cannot connect to host seahorse-app-d29hu.ondigitalocean.app:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')]
GeekGpt: HTTPError: 521 Server Error:  for url: https://ai.fakeopen.com/v1/chat/completions

Expected behavior
Expected an option to disable ssl or perhaps guidance on how to handle.

Desktop (please complete the following information):

  • OSX
  • Python 3.8.10
  • PIp 24

Additional context
Add any other context about the problem here.

[BUG]

Describe the bug
i am not able to get videos using pexels

To Reproduce
Steps to reproduce the behavior:
just pressed create video on front end

Screenshots
image

Desktop (please complete the following information):

  • OS: windows
  • Browser chorme
  • Python Version [e.g. 3.12]

Additional context
When i create testing function like this, everything works fine.
image

ERROR: The process "ffmpeg.exe" not found.

when I run the app ffmpeg.exe is not found

Expected behavior
Should be able to use ffmpeg.exe

Screenshots
this is the error
error
ffmpeg.exe is installed and the path is applied globally
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser chrome
  • Python Version 3.9

[BUG] Subtitle generation error

Describe the bug
A clear and concise description of what the bug is.
Error "Local subtitle generation has been disabled for the time being" during video generation

To Reproduce
Steps to reproduce the behavior:
1.Click "Generate"
2.Error appears after some time on the backend console

Expected behavior
A clear and concise description of what you expected to happen.
Generating video

Screenshots
If applicable, add screenshots to help explain your problem.
obraz

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox: 122.0
  • Python Version: 3.11.0

IMAGEMAGICK_BINARY binary path on MacOS

The README.md file is missing the path to the ImageMagick binaries, which are used for the IMAGEMAGICK_BINARY in .env.

If ImageMagick is installed via Homebrew, the path should be /opt/homebrew/Cellar/imagemagick/7.1.1-27/bin/magick

ffmpeg stays open

After finishing one video the next one cannot be generated because a failure while deleting the old files.

Moviepy - Done !                                           
Moviepy - video ready ../temp/output.mp4
[+] Video generated!
[+] Path: output.mp4
127.0.0.1 - - [05/Feb/2024 11:08:34] "POST /api/generate HTTP/1.1" 200 -
127.0.0.1 - - [05/Feb/2024 11:09:15] "OPTIONS /api/generate HTTP/1.1" 200 -
[-] Error: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: '../temp/04b5a108-fd17-477a-94b6-f29369f0e67a.mp4'  

Currently the only solution for me is stopping the process manually
taskkill /IM ffmpeg-win64-v4.2.2.exe /F

Additional:

  • Allow pressing the return key instead clicking "Generate"
  • Create Cancel Button

Systeminformation:
Windows 11 x64
Python 3.12.1

an error while creating the video

it says [-] Error: generate_subtitles() missing 2 required positional arguments: 'sentences' and 'audio_clips' does anyone know how to fix this issue ?
Screenshot 2024-02-07 215735

[BUG] THE PROGRAM IS UNABLE TO VERIFY ITSELF

Describe the bug
the code opens a chrome window in which the website chatgpt4 shows a cloudfare captcha, as i solve the captcha there comes a another one.

To Reproduce
Steps to reproduce the behavior:

  1. Go to localhost
  2. Type the content
  3. The code opens a new chrome tab
  4. See error

Expected behavior
The chatgpt site is supposed to open when i solve the captcha

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Python Version 3.9

the program cant find stock videos

[-] No Videos found.
{'status': 401, 'code': 'Unauthorized'}
=>
[-] No Videos found.
{'status': 401, 'code': 'Unauthorized'}
=>
[-] No Videos found.
{'status': 401, 'code': 'Unauthorized'}
=>
[-] No Videos found.
{'status': 401, 'code': 'Unauthorized'}
=>
[-] No Videos found.
{'status': 401, 'code': 'Unauthorized'}

Cant find module named "Playsound"

I having an issue when I run the python main.py it says "Cant find playsound module"

i tried doing python3 main.py. Now idk why it doesnt work

image_2024-02-02_100559476

[BUG] Vertical source videos are cropped and zoomed in instead of just resized.

Describe the bug
When a vertical video is downloaded it crops a very zoomed in part and resized that.

Expected behavior
Only resize without cropping when the source is a vertical video already.

Screenshots
Source:
1

Result in output:
2

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox
  • Python Version 3.11

Additional context
The cropping in general is not very good currently. For example sometimes a horizontal video gets squished instead of jsut cropped, but that's another issue.

I suggest using ffmpeg directly (can be used over moviepy too: https://zulko.github.io/moviepy/ref/ffmpeg.html ) to resize each clip before cropping. Also a check if the video even needs to be cropped (simple IF check to detect vertical video).

[-] Error: expected str, bytes or os.PathLike object, not NoneType

I cant get this to work no matter what i try, ive tried it in WSL and Windows now. but i always get stuck on the same error

After it builds the video, and before presumably adding video, audio and soundtrack it gives me this error, any ideas?

Seems its the function generate_video() which returns the error. But all the files are present, subtitle, video and audio

Moviepy - Done !
Moviepy - video ready ../temp/48d9f224-419c-4dc6-8d21-a9d1b6329f42.mp4
[-] Error: expected str, bytes or os.PathLike object, not NoneType

PS C:\Temp\MoneyPrinter> python .\Backend\main.py
Python-dotenv could not parse statement starting at line 4

  • Serving Flask app 'main'
  • Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:8080
  • Running on http://172.24.239.202:8080
    Press CTRL+C to quit
  • Restarting with stat
    Python-dotenv could not parse statement starting at line 4
  • Debugger is active!
  • Debugger PIN: 140-686-574
    127.0.0.1 - - [07/Feb/2024 12:04:43] "OPTIONS /api/generate HTTP/1.1" 200 -
    [+] Cleaned ../temp/ directory
    [+] Cleaned ../subtitles/ directory
    [Video to be generated]
    Subject: orange cats in winter
    Orange cats in winter have a unique beauty. Their vibrant fur stands out against the snowy landscape, creating a striking contrast. These cats are known for their resilience in cold weather, thanks to their thick coats.
    ["orange cats in winter", "winter orange cats", "orange cats snowy landscape", "vibrant fur orange cats", "resilience of orange cats in cold weather"]

Generated 5 search terms: orange cats in winter, winter orange cats, orange cats snowy landscape, vibrant fur orange cats, resilience of orange cats in cold weather
=>https://player.vimeo.com/external/512895949.sd.mp4?s=1e1acea7b0bb04271f39f1aca7a7c3b6e5f97d69&profile_id=139&oauth2_token_id=57447761
=>https://player.vimeo.com/external/512895949.sd.mp4?s=1e1acea7b0bb04271f39f1aca7a7c3b6e5f97d69&profile_id=139&oauth2_token_id=57447761
=>https://player.vimeo.com/external/473656910.sd.mp4?s=dccbd2edaae9f96d43ed1d378c96b09fab128a26&profile_id=165&oauth2_token_id=57447761
=>https://player.vimeo.com/external/561058367.hd.mp4?s=89c892f73b87c4465a6adea58f403f8ee675e1e9&profile_id=175&oauth2_token_id=57447761
=>https://player.vimeo.com/external/519481154.hd.mp4?s=d37ee19dd2e207f3cf3332beae54b6803745a4d8&profile_id=175&oauth2_token_id=57447761
[+] Downloading videos...
[+] Videos downloaded!
[+] Script generated!

    Orange cats in winter have a unique beauty. Their vibrant fur stands out against the snowy landscape, creating a striking contrast. These cats are known for their resilience in cold weather, thanks to their thick coats.

Service available!
Audio file saved successfully as '../temp/2c61adf7-a143-4f4a-9f0c-925fa0eb37de.mp3'
Service available!
Audio file saved successfully as '../temp/c937218a-5f94-4930-b98e-0fe9b7541693.mp3'
Service available!
Audio file saved successfully as '../temp/15f925bc-54d3-4406-88fc-117832b135af.mp3'
MoviePy - Writing audio in ../temp/fb2ff12b-083a-40f2-aab2-e10b470c1c6c.mp3
MoviePy - Done.
[+] Creating subtitles with assembly ai
[+] Subtitles generated.
[+] Combining videos...
[+] Each video will be 3.22 seconds long.
Moviepy - Building video ../temp/48d9f224-419c-4dc6-8d21-a9d1b6329f42.mp4.
Moviepy - Writing video ../temp/48d9f224-419c-4dc6-8d21-a9d1b6329f42.mp4

Moviepy - Done !
Moviepy - video ready ../temp/48d9f224-419c-4dc6-8d21-a9d1b6329f42.mp4
[-] Error: expected str, bytes or os.PathLike object, not NoneType
127.0.0.1 - - [07/Feb/2024 12:05:47] "POST /api/generate HTTP/1.1" 200 -

[BUG] Audio is not added to the final clip

Audio missing in the final clip
When I try to create a clip everything works fine. The single videos are downloaded, the audios are generated, the subtitles are generated. But in the final video output.mp4 the audio is missing.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Desktop:

  • OS: OSX
  • Browser: Chrome
  • Python Version: Python 3.11.7

Additional context

Service available!
Audio file saved successfully as '../temp/7994c07e-b35d-4ba1-9b5a-1f87920ccd45.mp3'
Service available!
Audio file saved successfully as '../temp/453ce14f-b319-4ca3-bb21-b08ee8709fae.mp3'
Service available!
Audio file saved successfully as '../temp/038200d5-2d7b-4b93-874d-1a9bef3b4bae.mp3'
Service available!
Audio file saved successfully as '../temp/eba79e40-99c5-429f-9e62-e180cea399db.mp3'
Service available!
Audio file saved successfully as '../temp/a58dc85b-2d11-4ca8-b528-2b9a290f027b.mp3'
Service available!
Audio file saved successfully as '../temp/d790fd9d-dae6-4f0e-88f4-e34caadbf0d5.mp3'
Service available!
Audio file saved successfully as '../temp/2f9fbcdd-f2cf-4c83-8ff3-10b63e3bbaf0.mp3'
Service available!
Audio file saved successfully as '../temp/30174d0a-b73b-433a-a50c-74a678bd81fe.mp3'
Service available!
Audio file saved successfully as '../temp/ebc9e0f3-7087-44a0-a72c-ce01736d0819.mp3'
Service available!
Audio file saved successfully as '../temp/73d906d6-48cb-4da6-bf3f-d0a0cf5a9959.mp3'
MoviePy - Writing audio in ../temp/b6d2cac3-5793-4102-a0fa-b40d733e2904.mp3
MoviePy - Done.
[+] Creating subtitles with assembly ai
[+] Subtitles generated.
[+] Combining videos...
[+] Each video will be 17.857999999999997 seconds long.
Moviepy - Building video ../temp/9b77de63-d2ff-4395-b6f2-6efd3d8ba677.mp4.
Moviepy - Writing video ../temp/9b77de63-d2ff-4395-b6f2-6efd3d8ba677.mp4

Moviepy - Done !
Moviepy - video ready ../temp/9b77de63-d2ff-4395-b6f2-6efd3d8ba677.mp4
Moviepy - Building video ../temp/output.mp4.
MoviePy - Writing audio in outputTEMP_MPY_wvf_snd.mp3
MoviePy - Done.
Moviepy - Writing video ../temp/output.mp4

Moviepy - Done !
Moviepy - video ready ../temp/output.mp4
[+] Video generated: output.mp4!

AttributeError: module 'attr' has no attribute 's'[BUG]

I'm running this on Ubuntu Linux server LTS, python 3. First issue - that works yes or does it need Windows instead?

Issue:
/usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (2.2.0) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "main.py", line 3, in
from gpt import *
File "/home/eff/MoneyPrinter/Backend/gpt.py", line 3, in
import g4f
File "/home/eff/.local/lib/python3.8/site-packages/g4f/init.py", line 6, in
from .models import Model, ModelUtils
File "/home/eff/.local/lib/python3.8/site-packages/g4f/models.py", line 3, in
from .Provider import RetryProvider, ProviderType
File "/home/eff/.local/lib/python3.8/site-packages/g4f/Provider/init.py", line 5, in
from .base_provider import AsyncProvider, AsyncGeneratorProvider
File "/home/eff/.local/lib/python3.8/site-packages/g4f/Provider/base_provider.py", line 9, in
from .helper import get_cookies, format_prompt
File "/home/eff/.local/lib/python3.8/site-packages/g4f/Provider/helper.py", line 7, in
from aiohttp import BaseConnector
File "/home/eff/.local/lib/python3.8/site-packages/aiohttp/init.py", line 6, in
from .client import (
File "/home/eff/.local/lib/python3.8/site-packages/aiohttp/client.py", line 38, in
from . import hdrs, http, payload
File "/home/eff/.local/lib/python3.8/site-packages/aiohttp/http.py", line 7, in
from .http_parser import (
File "/home/eff/.local/lib/python3.8/site-packages/aiohttp/http_parser.py", line 30, in
from .helpers import (
File "/home/eff/.local/lib/python3.8/site-packages/aiohttp/helpers.py", line 229, in
@attr.s(auto_attribs=True, frozen=True, slots=True)

Thanks

[Question] Is it possible to use non-English audio?

Just curious about possibility to change audio prounounce style from EN to other language. Trying to force the text using my local language but the result so weird since the text still pronounced in EN.

[BUG] Script Generation Includes Unwanted "Foundation Script:" Prefix and segments

When generating a script for a video, the output includes an unwanted prefix "Foundation Script:" and segment titles that sound too artificial in the video context.

Here's an example of the issue:

[Subject] Foundation Script:

**Segment 1: [First Topic]**
[Desired script content]

The "Foundation Script:" prefix appears before every script and it makes the output video sound weird. The segment titles, such as "Segment 1: [...]", make the video sound too artificial.

Expected output:
[Desired script content]
This issue occurs every time a script is generated. It's unclear whether this is a bug or a feature, but it's not the desired behavior for this use case.

I would like to contribute to this project by working on this issue. Please let me know if this is something that is supposed to be like this.

GPT keeps including a lot of instructions

GPT keeps givign me stuff like this when requesting; example "tokyo food culture"

    Tokyo Food Culture Script:

Segment 1: Introduction to Tokyo Food Culture
Tokyo, the bustling capital city of Japan, is not only known for its vibrant culture and advanced technology but also for its rich and diverse food culture. In this video, we will explore the fascinating world of Tokyo's food scene and discover the unique culinary experiences it has to offer.

Segment 2: Traditional Japanese Cuisine
One of the highlights of Tokyo's food culture is its traditional Japanese cuisine. Japanese cuisine is renowned for its emphasis on fresh, seasonal ingredients and meticulous preparation techniques. From sushi and sashimi to tempura and ramen, Tokyo is a paradise for food lovers seeking an authentic taste of Japan.

Segment 3: Street Food Delights
Tokyo is also famous for its vibrant street food scene. Street food stalls, known as yatai, can be found throughout the city, offering a wide variety of delicious and affordable treats. Whether it's takoyaki , Tokyo's street food is a must-try for any visitor.

Segment 4: Izakayas and Pub Culture
Izakayas, traditional Japanese pubs, are an integral part of Tokyo's food culture. These cozy establishments offer a relaxed atmosphere where locals gather to enjoy drinks and a wide range of small, flavorful dishes. Izakaya food is perfect for sharing and experiencing the social aspect of Tokyo's dining scene.

Segment 5: Michelin-Starred Dining
Tokyo boasts more Michelin-starred restaurants than any other city in the world. Fine dining in Tokyo is an art form, with chefs pushing the boundaries of creativity and craftsmanship. From sushi masterpieces to kaiseki meals, these culinary experiences are a testament to Tokyo's dedication to gastronomic excellence.

Segment 6: Unique Food Experiences
Tokyo is also known for its unique and quirky food experiences. From themed cafes, such as cat cafes and maid cafes, to robot restaurants and vending machines offering a variety of snacks, Tokyo never fails to surprise and delight visitors with its innovative approach to food.

Segment 7: Food Markets and Tsukiji Fish Market
No exploration of Tokyo's food culture would be complete without a visit to its bustling food markets. Tsukiji Fish Market, the largest fish market in the world, is a must-see for seafood enthusiasts. Here, you can witness the lively auction of fresh fish and indulge in some of the freshest sushi and sashimi available.

Segment 8: Conclusion
Tokyo's food culture is a reflection of its rich history, innovation, and dedication to culinary excellence. Whether you're a foodie looking to explore traditional Japanese cuisine or an adventurous eater seeking unique experiences, Tokyo offers a gastronomic journey like no other. Join us as we dive into the vibrant world of Tokyo's food culture and discover the flavors that make this city a true culinary paradise.

Note: The script provided above is a general outline for a video on Tokyo's food culture. The actual content and structure of the video may vary based on the specific requirements and preferences of the video creator.

This is obvisouely pretty long for a short. and includes a lot of instructions and such. I've tried to modify the prompt, but it keeps doign it. I see you have also tried your best to make it do what you want but. any tips?

Error generate "Could not retrieve stock videos: float division by zero"

Describe the bug
Video is not generating and a pop up is appearing on the browser and then the process terminates

To Reproduce
Steps to reproduce the behavior:

  1. Tun the program as normal
  2. Input string in the browser
  3. Error appears

Expected behavior
Audio is generated but a pop up appears on the browser "Could not retrieve stock videos: float division by zero"

Screenshots
image
Desktop (please complete the following information):

  • win 10
  • Edge browser
  • Python Version 3.10

Additional context
This is another thing i see in the console.
I am not sure which is causing the issue but both the error seems related
image

Error: 'NoneType' object has no attribute 'group'

hi, sorry if this is a simple question, but when running it, it sometimes gives me Error: 'NoneType' object has no attribute 'group' and sometimes [-] Error: 'videos' does anyone know how to fix this? thanks!
grafik
grafik
grafik

[+] Cleaned ../temp/ directory
[+] Cleaned ../subtitles/ directory
[Video to be generated]
Subject: testing video
Testing Video Script

"In this video, we will conduct a series of tests to demonstrate the performance and functionality of our new product. First, we will examine the durability of the materials used by subjecting the product to various impact tests. Next, we will evaluate the product's reliability by conducting stress tests under different environmental conditions. Additionally, we will showcase the product's user interface and highlight its intuitive design through a series of demonstrations. Finally, we will conclude by summarizing our findings and highlighting the key benefits of the product. Stay tuned as we put our product to the test and uncover its capabilities."

[
  "product testing video",
  "performance testing footage",
  "reliability test stock video",
  "stress test demonstration",
  "product durability showcase"
]

[*] GPT returned an unformatted response. Attempting to clean...
[-] Error: 'NoneType' object has no attribute 'group'
127.0.0.1 - - [02/Feb/2024 21:39:43] "POST /api/generate HTTP/1.1" 200 -

tree:
Auflistung der Ordnerpfade fΓΌr Volume Data
Volumeseriennummer : E82D-14AA
D:.
β”œβ”€β”€β”€Backend
β”‚ └───__pycache__
β”œβ”€β”€β”€fonts
β”œβ”€β”€β”€Frontend
β”œβ”€β”€β”€subtitles
└───temp

in .env
IMAGEMAGICK_BINARY="C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" # Download from https://imagemagick.org/script/download.php

(I did double backslash but github formats it as a single one for some reason)

[BUG] "Voiceover" is inserted into Subtitles, Script and actual Voiceover

Describe the bug
The resulting video has "Voiceover" as subtitle and actual Voice at the beginning of each new clip within the output.

Expected behavior
No "Voiceover" in the result

Screenshots
3

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Python Version 3.11

Additional context
I suspect this is caused by the ChatGPT output, because "Voiceover" already appears in the debug output when it initially generates the text.

MoviePY can't detect ImageMagick binary (windows)

Describe the bug
Sometimes the Backend/main.py can't be started and I receive the following errors:

(venv) PS E:\Development\Python\yt-automate\Backend> python main.py
Traceback (most recent call last):
  File "E:\Development\Python\yt-automate\Backend\main.py", line 4, in <module>
    from video import *
  File "E:\Development\Python\yt-automate\Backend\video.py", line 8, in <module>
    from moviepy.editor import *
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\editor.py", line 36, in <module>
    from .video.io.VideoFileClip import VideoFileClip     
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 3, in <module>
    from moviepy.audio.io.AudioFileClip import AudioFileClip
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 3, in <module>
    from moviepy.audio.AudioClip import AudioClip
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\audio\AudioClip.py", line 7, in <module>   
    from moviepy.audio.io.ffmpeg_audiowriter import ffmpeg_audiowrite
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 7, in <module>
    from moviepy.config import get_setting
  File "E:\Development\Python\yt-automate\venv\lib\site-packages\moviepy\config.py", line 67, in <module>
    raise IOError(
OSError: ImageMagick binary cannot be found at "C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" # Download from https://imagemagick.org/script/download.php

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo
  2. Create venv and install requirements.txt
  3. cd /Backend and python main.py
  4. See error

Expected behavior
Starting of the backend process

Desktop (please complete the following information):

  • OS: Windows 11
  • Python 3.10.6 (venv)

Additional context
It's feels kinda random.. I had the same issue yesterday too, when testing in between.. It was working before, and all the sudden it stopped working. I deleted the venv and re-installed requirements.txt in new venv.. It started working again, but now it doesn't.

I have verified the install paths mentioned in the OSError, the file is still there.

[BUG] Could not parse respons

Describe the bug
Script error after generating audio and on process get video from pexel

To Reproduce
Steps to reproduce the behavior:

  1. Just doing step like in docs
  2. Wait until audio generated
  3. Error appear

Expected behavior
Video generated

Screenshots
gambar

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Firefox
  • Python Version 3.11.7

Additional context
backend error log

[*] GPT returned an unformatted response. Attempting to clean...
[-] Could not parse response.
[-] Error: the JSON object must be str, bytes or bytearray, not list
127.0.0.1 - - [07/Feb/2024 23:27:36] "POST /api/generate HTTP/1.1" 200 -

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.