Skip to content

technoph1le/youtube-self-destruct-video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Self-Destruct Video

This YouTube video will be deleted once the channel reaches 4000 watch hours. Why 4000? Well, it's just a random number and no, it has nothing to do with monetization xD.

YouTube thumbnail

Watch on YouTube

How I did it?

The main script is located in the /backend/autoDeleteVideo.js file. We first need access to the YouTube Analytics API to check the channel's watch hours and YouTube Data API to authenticate and delete the video on my channel.

Also, I've set up GitHub Actions that does all of it for me once every 3 days. What about authenticating? Well, it's thanks to this file: /backend/getRefreshToken.js. It's only run once to sign in with the account and get the refresh token manually and then you don't need that file anymore. Because, we only care about the refresh token for this line of code for automatic authentication:

oauth2Client.setCredentials({ refresh_token: REFRESH_TOKEN });

Once the GitHub Actions have run, it'll also generate a JSON file in the /frontend/analytics.json folder, which I've used to set up a small landing page to show the data.

Here's a couple of useful resources if you want to dive deeper:

Some TODO works

  • Make a YouTube video, duh
  • Fix the frontend
  • Add a proper README

About

I coded a program that deletes this video when my channel reaches 4000 watch hours.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •