Making Automatic YouTube videos with Python
Using Python to completely automate content from Reddit into a popular KZread channel! With tools like Selenium, MoviePy, and Reddit's API, it's possible to create a video at the push of a button. This was a fun little project for me to practice Python, but I was surprised how successful KZread shorts are at getting views.
Source Code (reference only): github.com/Shifty-The-Dev/Red...
Reddit API: / apps
MoviePy: zulko.github.io/moviepy/
Music:
chill by sakura Hz
Пікірлер: 232
Interesting project but I *really* appreciate that you took the time to explain each step in just the right amount of detail.
@ShiftyTheDev
Жыл бұрын
Thank you! Editing alone took about twice the time as the project itself, so I'm glad ot was worth it
@sarcasmasaservice
Жыл бұрын
@@ShiftyTheDev It's a very good example of a meaty project, I'll be pointing my students to it. Thanks for sharing!
@Grinwa
5 ай бұрын
Nothing else to explain if u cant make that urself than never try it anyway Maybe, Try building calculators first
Just want to pin this here for anyone who wants to pursue making money with this idea: 1) To monetize shorts on KZread you need 10 MILLION views in the last 90 days. 2) This content likely won't be eligible for monetization You may be rejected from monetizing your channel as it could be a violation of repetitive content. The goal of this video was never "how to make Reddit videos for profit", but instead to explore the learning process behind automating with Python. I don't want to discourage anyone from learning, but if your sole objective is making money, this isn't it :)
@fernandoz6329
Жыл бұрын
I think the good part is the way around about KZread limitation using Selenium. Another challenge you can solve with Selenium is accesing to content when is firewalled with Google Authentication or another authentication methods. It is possible but there is some extra steps needed. Making money with youtube is always a moving target and it won't change. Video like these are a gold mine of knowledge. Thanks for sharing.
@OZD_Collective
7 ай бұрын
Tiktok is diff
@ggre55
Ай бұрын
@@OZD_Collectivewell thats big news Tnks I didnt know tktk allow that and actually its easier then uploading to ytb as ytb has limits for using the free api I was looking for new side projects to make money
Holy, this video is amazing? It's kinda scary to see small content creators somehow nailing that "I've got millions of subscribers and countless hours of video editing" vibes in their videos... I don't know how to describe it, but your video reeks of professionalism, as if you've created videos on a regular basis I'll start learning python right this instant, nothing can stop me now
@CS-ec7gl
Жыл бұрын
How's the Python learning going?
@wauwau1
Жыл бұрын
@CS-ec7gl currently watching Bro Codes full 12 hour course to get acquainted with Python, I'm at "Write a File" Not gonna lie, it's definitely a hefty amount of input and I gotta look up certain lines of code several times just to understand what's going on, but I'm making progress nonetheless If you have other recommendations for learning Python then I'm all ears, every bit of advice is appreciated!
@DecentralisedGames
Жыл бұрын
How do you know he doesn't have hundreds of channels? xD
@akshayy_xd
Жыл бұрын
yeah this is not hard go for it dude
@GloomyNate
Жыл бұрын
@@akshayy_xd this is hard for me and i really want to do this
Keep this content coming my dude! Excellent work with the storyline 🙌🏼
There are few channels which have the same video.... but the way you broke it down, step by step, line by line You legend just got a lifetime subscriber!!!
As a Python hobbyist thats climbing out of the beginner stage to the intermediate stage, this video is awesome. I hope you do more! I'll be here to watch them :)
@HURRY-UP-N-BUY
Жыл бұрын
How long have you been studying Python?
@doeverything15
7 ай бұрын
I have 3 or 4 channels running with this kind of python videos (other topics in other ways), and I win money from 2 of them. Yes, it is good at it sounds. But what I want to say you is I'm a beginner, I'm struggling with functions, so my "quality" is poor, but I made usefull and anti bug scripts that made money, the dificulty here is all that isn't python. Idea, niche, a way how the script will do all, find libraries, apply, praying god for stackoverflow having the solution (XD). But this can be done being a python begginer, you just need creativity
@tjkkobo5548
7 ай бұрын
@@doeverything15 would you be cool with sharing the code for the python videos?
What a way to start your channel! I'm looking forward to future videos that you might create. Subscribed.
The difference between someone who has done real things, and those who just make videos on KZread could be experienced in this video. excellent work.
Damn it i loved how you explained everything step by step. Got a new subscriber!
that's the second time I'm looking the video, I believe this is one of the best video on python I saw It's chill and clear, great job!
You are now my favorite python KZreadr, please do more videos like this
Sweet, I was just thinking about making an automated KZread channel! Now that I know it's definitely possible, I no longer have to try! Thanks for saving me the work!
Thanks man! This is fun and very useful information.
Great video! Really liked how you explained everything on point maybe that’s the push I needed to get back to python 😅
How you explain it's perfect to learn! Subscribed!
awesome project. keep up the great work
This proves an ethical concept I want to do but with Moviepy mainly
i like the editing and explain env , really apperciate it :) , new sub
first video but it feels like you've been here forever. subbed!
Took your idea as inspiration and started coding my own tiktok video „generator“ my code can already screenshot posts and comments and generate mp4 files for the tts! Thanks for this great video man
you are so good!I really think this is a wonderful video!
Love your explanations
Very interesting video, keep it up. Subscribed!
It was a really nice video! Keep it up! I created the same script 7 months earlier when this reddit thing begin and I was curios how you achieved the same thing.
Great video! learned a lot, Thanks.
As a beginner that just finished his python course, this video was well made and explained. Good job!!
@annefox2013
Жыл бұрын
What course did you take?
really nicely edited
Wow, My mind is blown, because i absolutely have no idea what you said; as I'm watching it at 1.75x but it sounds super fun. Will come back later or will have to watch a few million times before I understand. But trust me it was fun watching!!
This is a wonderful vid, I was always wondering how they created those videos and you method would be the hardest but easiest long term. Still not interested in making videos like this but its cool that you can do stuff like this with Python!
Amazing content, you got a sub 🔥🔥
YOU GONNA BOOM ON HERE BRO! GG
im a python student , learning for less than a year . THIS IS AMAZING
Very interesting. Subscribed. Pytjon is very flexible and automation is always something to invest time in. 15 hours of work is nothing if you can turn an idea into money.
Best video I’ve seen so far
Cracking Hard Work into Smart Work ... 👍👍👍
Really love your content, can you make more videos on automation using selenium? People go over the practical stuff but they don't tell what really goes through the code. Thx :)
This video is amazing, I would love to see more videos by you in the future! I'm really sure that most of these videos on Shorts, Instagram and TikTok are made in a similar way, it's pretty frustrating to see that they get magnitudes more of views compared to us small creators who put a lot of effort in our videos.
Great video! Maybe time to mess around with some machine learning in python and object recognition? Awesome video style.
Remember that Veggietales clip where they joke about the future of entertainment being "randomly generated" That clip has aged extremely well lmao
good project and instructional
So surprised this hasn’t blown up yet
awesome! 🎉
he explained it so well
Loving this make more vids
Damn, this is awesome. The video quality video too, even more impressive 😱 consider me inspired 😍
I like the final bit
@ShiftyTheDev
Жыл бұрын
Best part of the video honestly
Know nothing about code but this looks fun. Will try it out as soon as I know something.
@GloomyNate
Жыл бұрын
yo did you figure it out? i am lost brother.
Is there a way to make script go to the posts but no links when it's a link trhead?
Hello! Your platform is really impressive. I'm wondering if you could provide me with the necessary code for uploading videos to monetized channels on KZread? The steps for doing so may differ from the usual process. Currently I have javascript code that uploads to normal channels(Channels without monetization enabled)
That such an original idea. Crazy how no one has thought of that yet.
Got it to work but I'm trying to make it scrape other subreddits, and have ran into a good amount of issues.. any ideas?
love your voice btw. haha
While i try to upload the video the open dialogue box was coming i am unable to automate that in KZread also i am not able to scroll on the show more options and no it is not made for kids like that can please tell me how to do that ? It will be useful. For some cases
Great job! You have mastered python at such a fast pace. Very well explained video too. May I know what app did you use to create this video? Seems wonderful with all those effects and visuals
@ShiftyTheDev
Жыл бұрын
Thank you! The visuals were all done with Vegas Pro. Ironically it was a very manual process to animate
How you do these smooth animations?😅
4:26 oh god... the comment
@ShiftyTheDev
Жыл бұрын
I genuinely forgot about that, glad someone noticed!
freat video but i have a small question how do you fix the login via google popup selenuim take a screenshot post but then the popup shows and it cannot take screenshots of the comments
Very good animated video! I did kinda the same thing for a university project but we did it in C++ / Java. Will you make the code public in the future to look at it further in detail or was this just a show off and delete forever project?
@ShiftyTheDev
Жыл бұрын
Thank you! I'm planning on uploading the code to GitHub once I have a chance to clean it up/remove credentials/etc. I'll link it in the description in a few days
@dadadadadadadadadadadada951
Жыл бұрын
@@ShiftyTheDev Thank you very much, I appreciate it!
@ShiftyTheDev
Жыл бұрын
Repo link is now in the video description :)
cool!
I don't think I've ever seen that with the KZread API. Perhaps it's because I always use it via an App ID created in the Google Cloud. What I do see is the upload limit which is loads if you do it via the interface (even if automated. During testing of a new upload method you'll hit it but it's like a months worth of daily videos for most channels) but about 6 or 7 videos a day if you do it via the API. Which makes batch uploading and scheduling more difficult.
I am having trouble to make the python work from reference like screenshots and image clips . Too bad the author archived the discussion. Is anyone down to have a learning discussion about this?
Insane
For some reason, I can't make take screenshot of the posts or the comments. The audio file is fine though. Weird.
Ahh I need to learn to do this. I have all the images and text for hundreds of shorts a month in Notion but can't find a no code api solution.
Cool 👍
Fireship caught in 1080p 😂
I like this guy
Great video !! Sorry that i got problem while using and would like to get a help.I am competely new to python and followed the guide in the zip file ,but it showed FileNotFoundError: [WinError 3] the system cannot find the path specified:'outputDir' . I look it up on the internet,people said try to change the outputDir into the path of the file, however it is did not work. I had struggo in it about few hours but still can't figure it out.
@ShiftyTheDev
Жыл бұрын
It's looking for a directory that doesn't exist then. If you can print out the path it's trying to output to, it may help your troubleshooting. Do note that it expects the outputDir to be in the root of the project
Bs4 + selenium?
how did you deal with the reddit cokkie banner, when i want to screenshot the comment, the banner is alsways overdisplay it
This is what gets videos labeled as repetitious content. This is exactly what KZread doesn't want creators to do.
@ShiftyTheDev
Жыл бұрын
That's fair, this was more to explore how this could be fully-automated in Python. The source code I linked is just for reference, but I've had more than a few people expecting it to work out of the box, rather than learn from it. Thanks for watching!
@skrajina8037
Жыл бұрын
not really if u can make these videos unique and can be done easily with ffmpeg
@moki123g
Жыл бұрын
Completely agree. There is enough of this “content” on KZread already. Bad VR voice, canned, either stolen graphics or bad repetitive stock imagery and poorly written AI script. It's just spam.
@patrickedwards2078
Жыл бұрын
@@moki123g if people skip it then it will get like 10 views. If it's interesting then people will keep watching.
@boot-strapper
Жыл бұрын
@@moki123g its not spam if people like watching it, which based on the views numbers, they do.
I don't know if KZread has changed their API since you made this video, but I had no issues uploading to youtube using it.
Great Video!! Python just makes my life easier. I have a question: Are there copyright strikes for the reddit posts?
please please provide updated version of code or i will die until i solve errors
It would be nice to see an example. I used the text to speech package once but it just wasnt good. Arent there AI's one could use i dunno how the api works though
@ShiftyTheDev
Жыл бұрын
Source code is linked in the description if you wanna check that. The tts package definitely isn't the best, but all the nice AI voices I saw cost money to use
How about copyright? Is it legal to reuse content from reddit?
But the most import thing in the video i loved is sending the project to Recycle Bin due to ethical issues... hahaha
i got it work it was pretty tedious you forgot to tell us how to name the video files and the to create directories. But i figured it out and got the code to work. took me a grand total of 3 hours to get to work. great script.
@Cosmic-Cuts
6 ай бұрын
Hey do you remember what these extra steps were? I'm stuck now too, it prints out the top 4 posts and just loads infinitely after I choose one. I suspect I need to create folders like the BackgroundVideos and stuff. Thanks!
why use PRAW whene you already have selenium
I love the idea, if you don't mind could you please share the repo or codebase?
@ShiftyTheDev
Жыл бұрын
It's linked in the description, but is mostly for reference
bro Im not technical guy, can you help me to run this program, I change correctly reddit ID, argent, secret thing but still have error message suggests that the program is unable to find the specified directory 'OutputVideos' what do I need to do??
@ShiftyTheDev
Жыл бұрын
Create a directory called "OutputVideos" in the project
Very nice, I wouldn't bother capturing actual screenshots - you've already got the JSON data, just render it yourself
Does anyone know how he rendered this video??
@ShiftyTheDev
Жыл бұрын
This was made with Vegas Pro, but I've switched to using Davinci Resolve 18
Hi bro, video awasome. Can we run this from local machine or need server? If local machine means how many hours laptop should ON.
@ShiftyTheDev
Жыл бұрын
Thanks! I'm a little confused by your question but his can run on any Python supported device. This may be helpful for understanding kzread.info/dash/bejne/iIyh2K9rgdfbfbg.html The time this takes to run is about 2-3 minutes to generate a video, with most of that being render time
Amazing video! I just have one question. When you screenshot the div on reddit, you say the class = "Post'. I see the word "Post" in the class attribute of the div you are looking at but it is surrounded by a bunch of other gibberish that's probably unique to that specific post (something like: class="_1oQyIsiPHYt6nx7VOmd1sz _2rszc84L136gWQrkwH6IaM Post t3_18m8n51 "). How does your code still work even though the class is not equal to just "Post'"? I am getting NoSuchElementError errors.
@ShiftyTheDev
7 ай бұрын
HTML classes use a space as a delimiter, so searching for class "Post" should still get that element. Basically Selenium will treat that as a list of classes, and if any match it will return the element. I'm guessing the NoSuchElementError could be caused by the page still loading (I bumped into that issue a few times), so I'd try implementing waits and see if that helps
@malum_1
7 ай бұрын
@@ShiftyTheDev Oh, gotcha! Thanks so much for the reply. My issue ended up being that the browser Selenium was opening up was providing different HTML than my regular browser, which is curious. I just had to change what I was looking for in the HTML. I'm not sure why this is the case, but hey, it works now, so I'm happy to proceed. Thanks again for your reply, it sent me down the right path. Again, amazing video!
This is amazing! What video editing software do you use?
@ShiftyTheDev
Жыл бұрын
This was made with Vegas Pro, but I'm looking into moving to Davinci Resolve 18
@ShiftyTheDev
Жыл бұрын
@@Bulliegh I've never tried it since I don't have a mac
this is similar to what i did for 300+ videos. I ran the bot for like a year maybe to only get 40k views total hahahah, i really had a hope for this. I can share a link to my repo but youtube clearly doesn't need more of these channels lol
@diogosantos3112
Жыл бұрын
You didnt do shorts and the videos are very long, that was your problem bro
@keveydaking
Жыл бұрын
Were you monetized
@robosergTV
2 ай бұрын
github link? Thanks
Damn, just making the similar one in java, but with scrapping videos. Is ethical part so strong here? I mean if its not just a single screenshot, but a compilation of several funny\interesting things. When they gathered in one video for viewer's comfort, doesnt it change things?
@ShiftyTheDev
Жыл бұрын
I think there's a good argument for both sides of this. You could argue this serves the same purpose as a curator and gets the source material more traffic. Or you could argue it rips content to try and profit from it while requiring almost no work. At the end of the day, that's up to you. Personally, I chose to stop posting these shorts because 1) Doesn't make money without a lot more work (something like 10M views before KZread pays you) 2) I'm not a huge fan of spamming the platform 3) Content ownership concerns (this is where you could argue if curation adds value) 4) Probably the biggest one, the goal of this project was always to learn from, not just as a tutorial for specifically how to automate Reddit shorts. It's already served its purpose to me Sorry for the long comment, but I appreciate the conversation on the ethics of this. It's something I don't feel I covered enough in the video. Thanks for commenting :)
damn bro, i tried it from you github and it works great, but when selenium opens the firefox window, the reddit cookie banner pops up and im not logged in so its in german as default language. can i somehow circumvent that?
@ShiftyTheDev
Жыл бұрын
You could try something like this when it sets up the driver in reddit.py: options = Options() options.set_preference('intl.accept_languages', 'en-US') browser = webdriver.Firefox(options=options)
@theworldminusraphtheninjat4378
Жыл бұрын
did you solve it?
how long did this take to learn? I do data science in Python, and I always like the idea of branching out to other areas with cool side-projects like this, but learning all the various libraries seems like so much effort.
@ShiftyTheDev
Жыл бұрын
It was surprisingly quick (the whole project took about 3 days), the slowest part for me was trying to learn MoviePy and get the video layout how I wanted it. I think projects like this are a lot more approachable if you only focus on the specific part of the library you need, but yeah it does take some effort
@muffiincodes
Жыл бұрын
@@ShiftyTheDev sounds very cool. Will have to give it a go. Love the channel so far, as well. Looking forward to future videos.
Where do I find my user agent?
@ShiftyTheDev
Жыл бұрын
This is what I used: towardsdatascience.com/how-to-use-the-reddit-api-in-python-5e05ddfd1e5c Under the "Getting Access" section
Question... why parse Reddit? You have full text from the API. You could either a) Generate your own web page and screenshot that. b) Generate images with PIL.
@ShiftyTheDev
Жыл бұрын
You 100% could skip parsing Reddit if you wanted to. I chose to use Selenium since I was familiar with it, didn't want to mess with formatting my own screenshots, and figured it might be more interesting to talk about Selenium in the video. Great question!
there is a cookie pop up in the way. any idea how to get rid of it?
@theworldminusraphtheninjat4378
Жыл бұрын
did you solve it?
@HappyDay2283
Жыл бұрын
@@theworldminusraphtheninjat4378 yes. i used the same mechanics he uses to navigate the page, to search for the cookie banner and click the reject (or accept) button. You can find youtube videos explaing it further if you look for them.
Really like the project idea btw what software do you use to create for creating youtube videos
@ShiftyTheDev
Жыл бұрын
Thanks! I used Vegas Pro for this video, but have since switched to Davinci Resolve
@ZenCode0
Жыл бұрын
@@ShiftyTheDev Thanks
"They give me bone pain"
Great informative video, very inspiring. (Also quite explosive in the hands of the morally corrupt, but information wants to be free, and the natural evolution of solutions are them turning into new problems, so what can you do). An empowering video. Now do how to beat lethargy next, plz. I'd love to get off my lazy a$$ and hone my new skill I just feel I got.
Great video. A small tip on an otherwise excellent code : At 2:29 , instead of using "if A: continue" to filter out comments, better use "if not A : filter comments". If you insist on using "if A", then at least use an else statment. This is about the readability of your code, which in itself is good but also given your unusual situation where you show your code in a video is even more important. Cheers.
wait these videos aren't already auto generated?
Why does your video look like Fireship +1 sub
whats even more insane is that you can ask chat gpt to write all the code for you, i just did and im about to post the channel