YouTube Judol (Judi Online) Spam Detector
September 20, 2026 · View on GitHub
A Tampermonkey userscript that flags Indonesian online-gambling ("judol") spam comments on YouTube. Classification is done entirely by zero-shot text classification via classifier.dev (the jev decision model) — no fine-tuning, no hosted model, no API key.
Comments are classified as they scroll into view and batched into a single HTTP request.
Installation
Install from URL — with Tampermonkey installed, open:
https://raw.githubusercontent.com/arashari/youtube-judol-userscript-jev/main/youtube-judol-detector.user.js
Or manually:
- Install Tampermonkey (Chrome/Firefox/Edge) or Violentmonkey (Firefox).
- Open the dashboard and create a new script.
- Paste the full contents of
youtube-judol-detector.user.js. - Save (
Ctrl+S/Cmd+S). - Open any YouTube video and scroll to the comments.
How it works
- Scroll detection — an
IntersectionObserverqueues comments as they approach the viewport (200px margin). - Batching — queued comments are collected for
debounceMs(400ms), then up tobatchSize(50) are sent in onePOST https://classifier.dev/v1/classify. - Three labels — Jev picks one per comment:
promosi judi online→ judol (red, optionally hidden)spam promosi non-judi→ other spam (orange)komentar biasa→ clean
- Confidence — answers below
confidenceThreshold(0.6), or answers with no comparable score, are marked unsure (yellow) instead of spam. - Feedback — highlighting, badges, a "Hide All Judol" button, and a live stats panel.
The instructions field steers the model so that discussing, reporting on, or condemning gambling is not treated as promotion. This is what keeps comments like judi online itu haram clean.
Requests go through GM_xmlhttpRequest (with a fetch fallback) so YouTube's Content Security Policy can't silently block them.
Configuration
Edit CONFIG at the top of the script:
const CONFIG = {
apiUrl: 'https://classifier.dev/v1/classify',
tier: 'fast', // 'fast' (~250ms) or 'smart' (re-asks low-confidence answers, slower)
labels: {
judol: 'promosi judi online',
otherSpam: 'spam promosi non-judi',
clean: 'komentar biasa',
},
instructions: "...", // criteria that separate promotion from discussion
confidenceThreshold: 0.6,
sessionCap: 5000, // stop sending after N classifications on one page
batchSize: 50,
debounceMs: 400,
maxRetries: 3,
hideSpam: false,
highlightSpam: true,
highlightUnsure: true,
showBadge: true,
showStats: true,
logDebug: false,
debugScores: false, // badge EVERY comment (incl. clean) with the raw score map
};
Relabel labels and adjust instructions to change what counts as spam. Descriptive label names classify better than terse ones.
Tuning the threshold: set debugScores: true to badge every comment — including clean ones — with the raw score map, e.g. judol 0.99 · spam 0.01 · clean 0.00, colour-coded by verdict. It overrides showBadge and is the easiest way to see borderline cases before changing confidenceThreshold.
Limits and cost
classifier.dev's free tier is per IP: 3,000 classifications/minute and 20,000/day on the fast tier (200 / 2,000 on smart). One classification is one comment. The script handles 429 responses with Retry-After, retries 5xx with backoff, and stops at sessionCap.
The smart tier re-asks every single-label answer below 0.7 confidence of a reasoning model — better accuracy on ambiguous comments, but seconds per escalated item. For scrolling comment sections, fast is the right default.
Privacy
Comment text is sent to classifier.dev. Their documentation states the text is not stored or logged and goes only to the model provider for the classification. If that is not acceptable, run a dedicated deployment (see their docs) and point apiUrl at it.
Troubleshooting
- Nothing is flagged — set
logDebug: trueand check the console for[JudolDetector]lines. A400means the labels/instructions are malformed; a429means you hit the rate limit. - Comments are flagged as
unsure— Jev was not confident enough, or the API returned no score. LowerconfidenceThresholdto flag more aggressively. Errorscounter rises — the batch request failed after retries; those comments are re-queued and retried, then dropped.
License
MIT