Automating an entire Youtube channel with Terminal magic.


So I was wondering creating an entire youtube channel and running it with bash script cronjob.

One night I noticed there is a youtube channel which is doing nothing but making a compilation video of tik tok, there are lot of compilation video channels on youtube and those channels are just picking someone else content from other social media.

So I decided to create my own and running it with cronjob.

There are 3 things I have to do –

  • Finding content using reddit
  • Editing video using ffmpeg
  • Uploading video on youtube with python.

Script link ––

You can watch a Video explanation

Or read the text below –

1. Finding Content

I can use r/TikTokCringe to download 12 most upvotes tik tok video of that particular day. I can use youtube-dl to download these videos. It's pretty easy because in reddit if you add .json in the end of url you will get json output something like this.

So by using curl only this line is enough to download funny tiktok video –

youtube-dl $(curl -s -H "User-agent: 'your bot 0.1'" | jq '.' | grep url_overridden_by_dest | grep -Eoh "https:\/\/v\.redd\.it\/\w{13}") 

2. Editing video

Now these tik tok videos are vertical videos so First thing I have to do is adding the blur background in vertical video, to make it horizontal video. So I can use ffmpeg to add blur background. After looking online a little I found a weird command to do this trick and now I can run this command to all files using a for loop –

for f in .mp4; do ffmpeg -i $f -lavfi '[0:v]scale=ih16/9:-1,boxblur=luma_radius=min(h,w)/20:luma_power=1:chroma_radius=min(cw,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,crop=h=iw*9/16' -vb 800K blur/$f ; done 

Now in last I have to merge the videos to finish my editing. I can also download a subscription request video from youtube to just add it in the end and then use ffmpeg concat function to merge all videos and making one compilation video.

for f in blur/*.mp4; do echo "file $f" >> file_list.txt ; done ffmpeg -f concat -i file_list.txt final.mp4 

Don't forget to delete vertical and horizontal videos after making a final.mp4 file.

3. Uploading Video

Now this is very simple google have an article. Explaining how you can upload a youtube video by using python. You can read this article. It's provide a python2 script which require your google account outh2 authorization keys and then you can run this script in last.

python2 $HOME/bw/.local/bin/ --file="final.mp4" --title="Funny TikTok Compilation" --description="Buy my merchandise -" --keywords="tiktok,cringe" --category="22" --privacyStatus="public" 

You can post video in privacy status public so this way you don't have to worry about anything.

isn't that amazing?

This one simple script will run as cronjob daily and upload funny tik tok videos in 24 hours. Also these are most up voted tik tok on r/TikTokCringe So your video are pretty much high quality tik toks. So you will get good retention on your video. Also by running multiple channels like this you have a good chance of getting subscribers and you can find a way to monetize your channel and earn some Money.

I am very sure your videos will also get picked by stupid youtube algorithm.

BTW I am not going to do this thing by myself. Because I don't support putting someone else video and earning from it. I have my own youtube channel where I put original content. But since this is good idea I just wanted it to share with you.

submitted by /u/rakashraj
[link] [comments]