A Chrome extension that uses a self-hosted ML API to classify YouTube videos as constructive or non-constructive in real-time. Non-constructive content is blocked automatically.
- Blocks: Gaming, Entertainment, Vlogs, Pranks, Clickbait, Shorts
- Allows: Education, Music, News, Science & Technology
- Feed Pre-Scanner: Scans all thumbnails on the homepage and dims non-constructive videos before you even click
- Smart Caching: Learns channel decisions for instant future lookups
YouTube Page → Content Script scrapes metadata → Background sends to ML API → Block/Allow
The extension sends video title, channel, and description to our own Flask API server (/predict) which runs a Logistic Regression model trained on 9,000+ real YouTube videos. No third-party API keys needed.
- Clone this repo
- Go to
chrome://extensions/ - Enable Developer mode
- Click Load unpacked and select this folder
- The ML server URL is pre-configured — no setup needed
- Extension: Chrome Manifest V3 (content script + service worker)
- ML Server: Flask + scikit-learn (self-hosted on Oracle VM)
- Model: TF-IDF + Logistic Regression — 99.4% accuracy
- Batch API:
/predict/batchclassifies up to 50 videos in one request
The extension talks to a self-hosted Flask API at http://161.118.170.116:8080.
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Check if server & model are running |
/predict |
POST | Classify a single video |
/predict/batch |
POST | Classify up to 50 videos at once |
curl http://161.118.170.116:8080/health
Expected response:
{ "status": "ok", "model_loaded": true }curl -X POST http://161.118.170.116:8080/predict \
-H "Content-Type: application/json" \
-d '{"channel": "3Blue1Brown", "title": "Linear Algebra Explained", "description": "A visual guide"}'Response:
{ "constructive": true, "confidence": 0.9999, "message": "yes" }