# radio-stream-extractor `radiostreamscan` ist ein Go-Tool, das Radio-Streams aus Webseiten extrahiert. Es unterstützt: - **Web-UI (Default)**: Start ohne Argumente öffnet einen Server auf `:8080` mit Formular + JSON-Endpoint. - **CLI-Modus**: Übergibst du URLs als Argumente, werden Streams direkt ausgegeben. - **Playlist-Auflösung**: m3u/m3u8/pls/xspf/json werden erkannt, geladen und in echte Stream-URLs aufgelöst. - **Probing**: optionaler HEAD-Check für Stream-URLs (`-probe`). - **Export**: `-format text|json|csv|pls`. - **History-Log**: Ergebnisse werden als JSONL in `history.jsonl` gespeichert (abschaltbar mit `-history ""`). - **Concurrency**: parallelisierte Fetches mit `-concurrency`. ## Web-Server-Modus (Standard) ```sh go run ./cmd/radiostreamscan ``` Danach erreichst du die UI unter `http://localhost:8080/` (inkl. Ergebnis-Ansicht mit Copy-to-Clipboard). Der JSON-Endpoint ist: ``` /scan?url=https://example.com ``` Mehrere URLs: ``` /scan?url=a&url=b&url=c ``` ## CLI-Modus ```sh go run ./cmd/radiostreamscan https://live24.gr/radio/generic.jsp?sid=2676 ``` ## Flags (Auszug) - `-format` (text|json|csv|pls) - `-probe` (true/false) - `-header "Key: Value"` (repeatable) - `-proxy http://host:port` - `-history history.jsonl` (leer = aus) - `-watch 30s` (CLI wiederholt den Scan) - `-concurrency 4` - `-timeout 15s` (HTTP Timeout pro Request) - `-probe-timeout 8s` - `-allow-private` (lokale/private Ziele erlauben) ## Build / EXE ```sh go build -o radiostreamscan.exe ./cmd/radiostreamscan ``` Die EXE enthält Web-Server und CLI in einem Binary. ## Tests ```sh go test ./... ``` ## Projektstruktur - `cmd/radiostreamscan`: Hauptentrypoint mit URL-Scan, Webserver und Exporten - `internal/extractor`: Parser für Candidate-URLs + Playlist-Parser mit Unit-Tests