How to run a fully automated YouTube channel using Python
Step by Step Installation
In the previous blog post, I talked about my fairly new Python project that automatically generates videos off of Reddit posts using text-to-speech and uploads them to a YouTube channel.
Now, I will guide you through how you can install the project and run it on your own YouTube channel!
Installation 👨🏼💻
- Clone this Github repository
- Run
pip install -r requirements.txt
- Run
python -m playwright install and python -m playwright install deps
- Go to Free Cloud Computing Services — AWS Free Tier
- Sing in to the console
- Click on Open account menu
- Click on Security credentials
- Click on Create access key
- Once you created the access key and obtained the secret key, open the
config.toml
file in the project and update the following parameters accordingly.
[AmazonAWSCredential]
aws_access_key_id = 'YOUR AWS ACCESS KEY ID'
aws_secret_access_key = 'YOUR AWS SECRET ACCESS KEY'
5. Go to Reddit App Preferences and click on create another app at the bottom.
- Fill out the required details, make sure to select script and click on create app.
- Make a note of the personal use script & secret token and update the the following credentials in the
config.toml
file.
[RedditCredential]
client_id='YOUR PERSONAL USE SCRIPT'
client_secret='YOUR SECRET TOKEN'
user_agent='{YOUR REDDIT PROJECT NAME} v4.0 by /u/{YOUR REDDIT USERNAME}'
username='YOUR REDDIT USERNAME'
passkey='YOUR REDDIT PASSWORD'
6. At this point you can run the the program and generate a video however before that you need to updating a few more parameter in the config.toml
file.
[Directory]
# absolute path to where this project is cloned or downloaded e.g: Desktop/YoutubeAutomation-Reddit
path=''
# --------------------------------------------
[Background]
# absolute path to the background video e.g: Desktop/minecraft.mp4
path=''
You can download any YouTube video as a background and add its path to the config.toml
file. Here are a few options:
- Minecraft (1:20 h): https://youtu.be/n_Dv4JMiwK8
- GTA (1:00 h): https://youtu.be/qdvjZ1bUw68
- Subway Surfer (1:05 h): https://youtu.be/ChBg4aowzX8
7. If you want the app to automatically upload the generated video into your Youtube channel, first set upload_to_youtube = true
and specify how often you want the app to upload a video (in seconds). I don't recommond anything less than every 6 hours because you will reach your qouta limit.
[App]
# whether the result video should be uploaded to your youtube channel
upload_to_youtube=false
# how often should the app be run (in seconds) e.g: every 6 hours -> 21600 seconds
run_every=21600
8. Finally you need to enable the Youtube api to be able to upload videos from your computer. This process is a bit more involved, so I’ll link to a video tutorial. Just follow the steps until minute 10:58 and you will be able to get a client_id
and a client_secret
. Update the following parameters and HOORAY 🥳🥳
All we are left do is to run
python main.py
And let the app do the the rest!
Source:
https://amir-tech.medium.com/how-to-run-a-fully-automated-youtube-channel-using-python-19d4878a1cff
0 comments:
Post a Comment