geesawra.industries/hydraulophone
An unofficial YouTube Music app for iPhone, iPad, and Mac.
Better Lyrics TTML provider
Sources consulted
- Better Lyrics current API introduction, GET
/getLyrics, authentication, and rate limiting, consulted 2026-09-24. - MetroList BetterLyrics.kt and TTMLParser.kt, pinned commit
28fa8f042bfabb880bdecc0d9fa37e86cf72b90e.
Observed contract and local choices
The documented current base URL is https://api.betterlyrics.org. GET /getLyrics takes song title (s) and artist (a), plus album (al) and duration (d) when known; a successful JSON response contains a TTML string. MetroList uses the earlier lyrics-api.boidu.dev host and converts TTML into its LRC view model. Hydraulophone uses the current documented host and decodes TTML directly into SongLyrics.
Hydraulophone sends one request with the original title and artist, without broadening or stripping version labels. The XML parser supports line timing and optional word/syllable runs with clock (mm:ss, hh:mm:ss) and offset (s, ms, m, h) forms, ttp: timing attributes, and lyricOffset. Direct text spacing is retained, so valid LyricsWord.text runs concatenate exactly to LyricsLine.text. Incomplete word timing drops only the word timeline; the timed line remains available. Translation, romanization, and background-role spans are omitted from the main line. TTML agent routing and vocal layering are not represented in the initial UI.
XMLParser is configured never to resolve external entities, and DTD/entity declarations are rejected before parsing. The adapter uses an ephemeral no-cookie, no-cache URLSession, eight-second request and twelve-second resource timeouts, a 512 KiB response limit, and a redirect-refusing task delegate. It sends no YouTube session, video ID, or Better Lyrics API key. The request discloses title, artist, and available album and duration to Better Lyrics. The domain-facing service performs the app authentication check before calling this provider.
HTTP 404 means no lyrics. Because this client sends no API key, the documented HTTP 401 uncached-song response is also treated as absence so the provider chain continues to LRCLIB and native static lyrics. Malformed responses and other statuses remain typed errors. HTTP 429 pauses further requests for Retry-After (or a bounded default) without automatic retries. The API documentation says cache hits can be served without a key, while uncached requests may return HTTP 401; new keys are currently not issued. A public sample on the older MetroList host returned 401 during development, while the current documented host returned timed lyrics for the documentation's cached example. No key or authentication workaround is embedded.
This is a clean Swift implementation of observed protocol behavior, not a port of MetroList's GPL-3.0 Kotlin source. If TTML shapes, endpoint access, or key rules change, update this adapter and its offline fixtures before changing matching policy. The app renders fetched words transiently and does not persist a lyrics cache.