Skip to content

Riotcoke123/StreamGuard-YouTube-Bot-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamGuard - YouTube Bot Detection

StreamGuard is a Python script designed to analyze YouTube live chat streams and estimate the number of real viewers versus potential bot accounts. It collects live chat messages, analyzes chat activity patterns, and provides an estimation of viewer authenticity based on chat behavior.

Features

  • Automatically detects active YouTube live streams on a specified channel.
  • Collects and analyzes live chat messages over a configurable time window.
  • Detects suspicious chat activity indicating potential bots.
  • Estimates real viewers and bots based on chat-to-viewer ratios.
  • Logs analysis results in a JSON file for further inspection.

Requirements

  • Python 3.8 or later
  • Google API Client Library for Python (google-api-python-client)
  • YouTube Data API v3 Key

Getting a YouTube Data API Key

To use this script, you need to obtain a YouTube Data API v3 key. Follow these steps:

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Enable the YouTube Data API v3 under "APIs & Services".
  4. Navigate to "Credentials" and create an API key.
  5. Use this key in the API_KEY configuration of the script.

Installation

pip install google-api-python-client

Usage

  1. Clone the repository:
    git clone https://github.com/Riotcoke123/StreamGuard-YouTube-Bot-Detection.git
  2. Set your YouTube Data API key and target channel ID in the script configuration.
  3. Run the script:
    python yt.py

Configuration

The main configuration parameters can be adjusted at the top of the script:

  • API_KEY: Your YouTube Data API v3 key.
  • CHANNEL_ID: The YouTube channel ID to monitor.
  • CHAT_COLLECTION_DURATION_SEC: Duration in seconds to collect chat messages during each analysis.
  • BOT_ESTIMATION_INTERVAL_SEC: Time interval between bot detection runs.

License

This project is licensed under the GNU General Public License v3.0.

Repository

Find the project on GitHub: https://github.com/Riotcoke123/StreamGuard-YouTube-Bot-Detection

© 2025 StreamGuard Project. Licensed under GPLv3.