I created a video bot and went VIRAL

We Science Too
67 followers
7 Video Views·Oct 22, 2022
Have you ever seen these types of videos? Reddit videos are constantly taking over
short form video content through Instagram, TikTok, and YouTube, and get millions and
millions of views. They all follow the same formula, Minecraft background with an AskReddit
thread being read out by a robot. The only part of this that's being done by a human is stitching
it all together. Not anymore. I spent two days on and off automating this process. Finally,
I made a bot that makes these Reddit videos with just one simple command. Here's how it works.
First, it uses the Reddit API to grab a random thread of the AskReddit subreddit with the
comments that match that subreddit. Second, it grabs the title and comments and then translates
the text using text-to-speech using the Google Text-to-Speech Python package. This will then
save in an MP3 file to use later. Third, it uses Playwright to simulate the browser and grab
screenshots of each of the Reddit comments that correlate with the comments chosen and saves it
to a PNG file. Fourth, it downloads the Minecraft background and then chops at some random point in
the video to truly get a different result every single time. Fifth, using MoviePie, it edits all
these clips together and uses some extreme basic math to find out when to switch images and we have
a final product. Here it is in much more detail if you want to get your feet wet. We get a Reddit
object that looks like a list of threads with the associated comments. We then pass that into a
We then pass that Reddit object into a function called SaveTextToMP3. In there, we get the thread
title and then save it as a title.mp3. We then go through the comments and save them all as MP3 as
well. After each iteration, after we save the MP3 file, we get the length in seconds of the file so
that we don't go over 50 seconds. Once it's over 50 seconds, we stop making these files. The length
of the MP3 files and the number of MP3 files is then put in the length and number of comments
variables. We then call DownloadScreenshotsOfRedditPosts where we pass in the Reddit object
and the number of screenshots to generate. Using Playwright, we launch Chrome and then go to the
part where it shows the title, screenshot it, and then save it to a PNG file. Then we loop through
the comments and then screenshot each individual comment until the number of comments passes. We
then check to see if the background has been downloaded. If it hasn't, then we download the
Minecraft background. Using the length of all the clips we received from the MP3 files, we pass into
a function we call ChopBackgroundVideo. This will create a clip in the Minecraft video that will
match the time of all MP3 files. We then call MakeFinalVideo. This is where MoviePie does all
this magic to spit out a final video with all the assets we created. I open-sourced the code so
anyone can use it. I tried to make the code as readable as possible for people who wanted to
contribute and add on to the software. It's still fairly limited in its current state and I knew
that beginners would get a kick out of contributing to something they can relate to.
Some of the outputs are just hilarious too. They can range from cringe to just borderline hilarious
or silly. What's a random obscure fact you know? Australia is wider than the moon. What is the most
embarrassing thing you've ever witnessed? I used to work for a small coffee shop that had three
locations. What's something Gen Z isn't ready to hear? That one day you too will be outdated.
I made a short showcasing my work and the response was unexpected to say the least.
Over 1.3 million views on TikTok, 150k views on YouTube, and hitting GitHub trending for multiple
days caused this project to just spiral out of control. A couple of things stood out to me.
First, the amount of people who wanted to learn how to code using this project was pretty surprising
to me. Usually people are pretty explicit with wanting to learn code but the Reddit video bot
was almost like a Trojan horse for introducing people to learn code. Second was the amount of
people who really, really don't like this type of content. A lot of Reddit accounts posted a comment
saying that the project was cool but they weren't bots. Some of the responses to those comments were
sometimes pretty funny. After 24 hours of this video going public, the amount of feature requests
and then feature implementations was just absolutely nuts. At the bottom of this project,
which you can find in the description by the way, I added some features that can be used to make this
project much easier. Almost all of them have been completed and the team on my Discord server had to
basically do a 180 and maintain a project. So shout out to Callum, Freebie, Harry, and Pix for helping
maintain all of this. Also shout out to all of the contributors for making this project such a fun
collaboration to work on with the community. So here are some things I have learned from this.
I have always had respect for open source maintainers but my respect for them has broken
the ceiling at this point. The amount of time I have put in after releasing this has been
overwhelming. Currently there are over 116 open issues and 20 open pull requests. Second, developing
through open source is the best way to learn code as a maintainer and someone trying to contribute.
I believe this because of the amount of code you have to read. As a maintainer, I'm trying to make
the code base as easy as possible to enter for newcomers so editing and reviewing code is a long
process. As someone who's contributing code, trying to use a software you haven't used before
to add more to it is also a daunting task. The community response to all of this is amazing but
what truly motivates me is the people who see something bigger in this project. Some people
on my Discord channel, link in the description, think that it can be used as a way to automate
almost all forms of low quality content. After hearing this and then going on my own algorithm,
I started to realize that there is a huge amount of similar content using different websites as
reference or even just straight up taking YouTube videos and playing them over a video game
background. There are also some other great ideas like doing Twitter threads instead of Reddit
threads, using green text stories, doing a compilation of memes, transcribing a funny
audio passage, summarizing a news article in just one paragraph and have it read out with
relevant screenshots. This also presents another issue that people had with my bot. By creating a
bot that automates the process of making lower quality content, I am essentially saturating the
market with this low quality content. My thought process is a little different. You can create this
type of content on your phone if you needed to. My point of making this was to help people learn
a code by coding something they would see practical. If this low quality content exists,
then it will always exist even if I made a bot for it or not. Of course, you can find the link
to this bot in the description if you want to try it yourself or contribute to it. What things would
you like to see me automate next? If you want to join the discussion or the contribution of this
bot, make sure you check out my Discord channel in the description below. Thanks for watching!
