YouTube Spammer Purge
Allows you to purge all reply comments left by a user on a YouTube channel or video.
Purpose
Recently, there has been a massive infestation of spam on YouTube where fake impersonator accounts leave spam/scam replies to hundreds of users on a creator's videos. For some god-forsaken reason, YouTube offers no way to delete all comments by a specific user at once, meaning you must delete them one by one BY HAND.
YouTube offers a functionality to ban a user, but it does NOT delete previous comments. Therefore I created this script to allow you to instantly purge their spam replies.
Usage Notes
-
Because of its limited purpose, the script ONLY deletes replies, not top-level comments. That functionality may be added later if needed.
-
To use this script, you will need to obtain your own API credentials file by making a project via the Google Developers Console (aka 'Google Cloud Platform'). The credential file should be re-named 'client_secret.json' and be placed in the same directory as this script. See Instructions below.
-
I suck at programming so if something doesn't work I'll try to fix it but might not even know how, so don't expect too much.
Screenshots
Installation
The script file is standalone, but you DO need to acquire your own API credentials file to access the YouTube API - See instructions below.
Instructions - Obtaining YouTube API Key
To use this script, you will need an "Oauth2" credential to access the scanning and deletion functions via YouTube's Data API. Otherwise this script won't work at all.
-
Log into Google Developer's Console with your Google account that has your YouTube channel: https://console.cloud.google.com/apis/dashboard
-
On the top blue bar nex to where it says "Google Cloud Platform", click the dropdown to 'Select a Project'. (If you have existing projects, it may instead show the name of one)
-
In the "Select a Project" Window click "New Project"
-
Enter some project name, it doesn't really matter, then click 'Create'
-
Make sure the project you just created is active, with it showing at the top, then click "Library" on the left menu.
-
Scroll down and click the box that says "YouTube Data API v3"
-
Click "Enable" and wait for it to load. It will take you to another page.
-
Click "Create Credentials". (Note: If you don't see this page, open the left pop-out menu and click "APIs & Services" > "Dashboard". Then in the table/list on the page, look in the 'Name' column, and click "YouTube Data API v3")
-
In the dropdown, select "YouTube Data API v3", then select "User Data", and click Next
-
Under "Oauth Consent Screen", fill out the required fields with some name, select your email, and enter an email below too. It doesn't really matter what you put here. Then click "Save and Continue"
-
Click "Add or Remove Scopes", then find the one that says ".../auth/youtube.force-ssl", click the check box, then at the bottom click "Update". Then click "Save and Continue"
-
Under "Oauth Client ID", just select 'Desktop App'. You can set a name or not. Then click "create".
-
Now click "Download" to download the credentials json file. Rename it to "client_secrets.json" and save it into the same directory as the python script. Then click done.
-
Now you should be able to run the python script. It will ask you to log in, and the session will last about an hour before expiring.