[Script] Automate Youtube Shorts Generation

BlogPro

Elite Member
Jr. Executive VIP
Jr. VIP
Joined
Apr 23, 2012
Messages
2,852
Reaction score
5,868
Hope y'all are having a fine Sunday.

I've recently been going hard at the Youtube game. Came across this script.

I currently have no direct use for this, but I thought some of you might find it useful.

Link to Github - https://github.com/FujiwaraChoki/MoneyPrinter

What does it do?
It uses ChatGPT, TikTok Text to Speech (unofficial API), AssemblyAI (Speech to Subtitle API) and Pexels API (Free Video) to automatically generate Youtube Shorts.

How to use it?

1. Install Python

2. In your terminal run

Code:
git clone https://github.com/FujiwaraChoki/MoneyPrinter.git
cd MoneyPrinter

This will download the Github repository to your local machine.

If you're unfamiliar with that, you can download the file in Zip format, extract it and then run cd MoneyPrinter

2. Once in there, run

Code:
pip install -r requirements.txt

This will install all the required python libraries

3. Now open your project directory in your favorite editor and edit .env.example

You will need to enter your AssemblyAI API Key, OpenAI API key, Pexels API Key, TikTok Session ID (I'll tell you below how to get it)

Once done, run

Code:
cp .env.example .env

Alright, now you should be ready. Let's run the Flask Application

Code:
cd Backend
python main.py

And finish off by running the front end server

Code:
cd ../Frontend
python -m http.server 3000

//

Generating a video
  1. Open http://localhost:3000 in your browser
  2. Enter a topic to talk about
  3. Click on the "Generate" button
  4. Wait for the video to be generated
  5. The video's location is MoneyPrinter/output.mp4
How to get TikTok Session ID?
  1. Log in to the TikTok Web App
  2. Install the Cookie Editor extension for your browser.
  3. Open the extension and look for "sessionid"
  4. Copy it and paste it.

//

Here's a video by the author

//

This can very easily be modified to automate the video production, integrate ElevanLabs API instead of TikTok, integrate Story Blocks/Freepik/Adobe Stock etc.

I hope some of y'all find it useful.
 
Good share, i also coded the same thing but video generating process was taking hell lot of time.
 
Good share, i also coded the same thing but video generating process was taking hell lot of time.

How much time did it typically take you for one short?

I'd be interested in making a web based version of this that you can plop on a VPS. And share it here (for free of course).
 
How much time did it typically take you for one short?

I'd be interested in making a web based version of this that you can plop on a VPS. And share it here (for free of course).
It took me a few days. I used the ChatGPT API, Pexels API, and the Python library MoviePy. While adding voiceovers through the Elevenlabs API, I encountered challenges with video syncing. The process of combining elements and generating the final output was time-consuming, taking hours for just a single video. Considering the effort and time invested, it didn't prove to be worthwhile.
 
It took me a few days. I used the ChatGPT API, Pexels API, and the Python library MoviePy. While adding voiceovers through the Elevenlabs API, I encountered challenges with video syncing. The process of combining elements and generating the final output was time-consuming, taking hours for just a single video. Considering the effort and time invested, it didn't prove to be worthwhile.

For video syncing you can use the Assembly API like this script uses. It converts audio to subtitles and then "burns" them on the video.

My concern is the "hours for just a single video" element of your script.

Did you try to debug further?

I tried the above script, removed pexels and instead implemented Dall-E 3 with random pans and zoom. And from image generation to implementation it took 7 minutes on a relatively decent quality video.

Because that defeats the entire purpose. You can make a high quality short manually in about 30 minutes, if you know what you're doing.

//

If there is enough interest, I'd be happy to code a working script for BHW.
 
Can I use this to make TikTok videos? How do I get all d api to use? Are they paid? Pls help !
 
Can I use this to make TikTok videos? How do I get all d api to use? Are they paid? Pls help !

It makes vertical videos. So why not?

All the APIs are listed there. Please do some of your own research.

I have given specific instructions for stuff like TikTok session ID
 
Hope y'all are having a fine Sunday.

I've recently been going hard at the Youtube game. Came across this script.

I currently have no direct use for this, but I thought some of you might find it useful.

Link to Github - https://github.com/FujiwaraChoki/MoneyPrinter

What does it do?
It uses ChatGPT, TikTok Text to Speech (unofficial API), AssemblyAI (Speech to Subtitle API) and Pexels API (Free Video) to automatically generate Youtube Shorts.

How to use it?

1. Install Python

2. In your terminal run

Code:
git clone https://github.com/FujiwaraChoki/MoneyPrinter.git
cd MoneyPrinter

This will download the Github repository to your local machine.

If you're unfamiliar with that, you can download the file in Zip format, extract it and then run cd MoneyPrinter

2. Once in there, run

Code:
pip install -r requirements.txt

This will install all the required python libraries

3. Now open your project directory in your favorite editor and edit .env.example

You will need to enter your AssemblyAI API Key, OpenAI API key, Pexels API Key, TikTok Session ID (I'll tell you below how to get it)

Once done, run

Code:
cp .env.example .env

Alright, now you should be ready. Let's run the Flask Application

Code:
cd Backend
python main.py

And finish off by running the front end server

Code:
cd ../Frontend
python -m http.server 3000

//

Generating a video
  1. Open http://localhost:3000 in your browser
  2. Enter a topic to talk about
  3. Click on the "Generate" button
  4. Wait for the video to be generated
  5. The video's location is MoneyPrinter/output.mp4
How to get TikTok Session ID?
  1. Log in to the TikTok Web App
  2. Install the Cookie Editor extension for your browser.
  3. Open the extension and look for "sessionid"
  4. Copy it and paste it.

//

Here's a video by the author

//

This can very easily be modified to automate the video production, integrate ElevanLabs API instead of TikTok, integrate Story Blocks/Freepik/Adobe Stock etc.

I hope some of y'all find it useful.
fantastic share OP!
 
I modified this to work with ffmpeg instead of moviepy. I get 30 seconds to 1 minute videos in about 5-6 minutes on my phone, with Termux!
 
https://github.com/Troptrap/MoneyPrinter-EnhancedIt's this repo. But it's a mess, if you don't have a bit of Python/Linux knowledge it will be a little bit harder to install. Specifically, requirements are broken in this version (I think, I'm not sure lol). What I have locally is more advanced ( still messy) but not ready yet.

L.E. Also instructions are kinda deprecated.
 
pexels can't accept new member now , what can i do?
 
Back
Top