Skip to content

ponyo877/supacha

Repository files navigation

supacha

A command-line tool that extracts and analyzes Super Chat data from YouTube livestream replays.

It fetches all paid messages from a given video, converts amounts to JPY using real-time exchange rates, and displays a ranked summary.

Features

  • Extracts Super Chat messages from YouTube livestream chat replays
  • Converts 15+ currencies to JPY via the Frankfurter API
  • Displays a TOP 20 ranking by amount with per-currency and aggregate summaries
  • Handles CJK usernames with proper column alignment
  • Adaptive rate limiting for reliable YouTube API pagination
  • Zero external Go dependencies (standard library + golang.org/x/text)

Installation

go install github.com/ponyo877/supacha@latest

Or build from source:

git clone https://github.com/ponyo877/supacha.git
cd supacha
go build -o supacha

Usage

./supacha "https://www.youtube.com/watch?v=VIDEO_ID"

Note: Quote the URL to prevent the shell from interpreting ? and & as special characters.

Supported URL formats:

"https://www.youtube.com/watch?v=VIDEO_ID"
"https://youtu.be/VIDEO_ID"
"https://www.youtube.com/live/VIDEO_ID"
VIDEO_ID

Example Output

============ TOP 20 ============
 #  JPY Amount  Orig   User        Time
 1  ¥50,000     $327   Alice       12:34
 2  ¥10,000     €61    Bob         45:01
 ...

========== SUMMARY ==========
 Currency  Count  Total
 USD          5   $1,200
 EUR          3   €500
 JPY          2   ¥15,000
─────────────────────────────
 Total (USD)       $1,850.00
 Total (JPY)     ¥283,050

Supported Currencies

USD, EUR, JPY, GBP, INR, KRW, CAD, AUD, HKD, TWD, BRL, MXN, NZD, PHP, ILS, THB

How It Works

  1. Parses the video ID from the provided URL
  2. Scrapes the YouTube page for API credentials and continuation tokens
  3. Fetches exchange rates for the video's publish date
  4. Iterates through the chat replay API to collect all Super Chat messages
  5. Parses amounts, converts to JPY, and renders the ranking and summary

Testing

go test ./...

License

MIT

About

A command-line tool that extracts and analyzes Super Chat data from YouTube livestream replays.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages