~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/hydraulophone

An unofficial YouTube Music app for iPhone, iPad, and Mac.

0
0
main
60 lines · 4.0 KB Raw History
# Lyrics browse protocol

Hydraulophone can retrieve static lyrics for the signed-in track through
InnerTube's `next` and `browse` operations. BetterLyrics and LRCLIB supply
timed lyrics when available. No account data or lyrics response is saved in
fixtures, logs, or persistent storage.

## Sources consulted

- Pinned AuraMusic commit `185a77d31733047de06cbec619d40731755a0ec1`:
  [`YouTube.kt` `next` and `lyrics`](https://github.com/TeamAuraMusic/AuraMusic/blob/185a77d31733047de06cbec619d40731755a0ec1/innertube/src/main/kotlin/com/auramusic/innertube/YouTube.kt#L1305-L1383).
  AuraMusic scans watch-next tabs for an `MPLYt` browse ID and posts that ID
  (with optional `params`) to `browse`. Its implementation reads the plain
  `musicDescriptionShelfRenderer.description.runs` shape.
- Maintained [ytmusicapi lyrics browse implementation](https://github.com/sigma67/ytmusicapi/blob/main/ytmusicapi/mixins/browsing.py#L920-L999),
  [timed path](https://github.com/sigma67/ytmusicapi/blob/main/ytmusicapi/navigation.py#L698-L715),
  and [cue fields](https://github.com/sigma67/ytmusicapi/blob/main/ytmusicapi/models/lyrics.py#L294-L340),
  consulted 2026-09-24. Its mobile browse profile selects `ANDROID_MUSIC`
  `7.21.50` and can return `timedLyricsData` with millisecond cue ranges.
  However, [issue #828](https://github.com/sigma67/ytmusicapi/issues/828)
  and [discussion #835](https://github.com/sigma67/ytmusicapi/discussions/835)
  reproduce HTTP 400 when that timestamped request uses browser-cookie
  authentication, even while plain lyrics work. Hydraulophone's authenticated
  simulator probe on 2026-09-24 reproduced HTTP 400. We therefore do not send
  the mobile browse in normal use. This is supporting protocol evidence;
  Hydraulophone does not depend on the Python package at runtime.
- Pinned AuraMusic [LRCLIB provider](https://github.com/TeamAuraMusic/AuraMusic/blob/185a77d31733047de06cbec619d40731755a0ec1/app/src/main/kotlin/com/auramusic/app/lyrics/LrcLibLyricsProvider.kt)
  and [search/matching adapter](https://github.com/TeamAuraMusic/AuraMusic/blob/185a77d31733047de06cbec619d40731755a0ec1/lrclib/src/main/kotlin/com/auramusic/lrclib/LrcLib.kt)
  at the same commit. AuraMusic uses the public LRCLIB catalog as one lyrics
  source and prefers synchronized text when a suitable track match exists.

## Adapter choices

The authenticated service tries BetterLyrics, then LRCLIB, then posts `next`
with the current video's ID. A timed result stops the chain; otherwise an
earlier plain result remains available if the final YouTube response is
missing or fails. It scans
all tabs because their positions are not stable. If a lyrics browse endpoint
exists, the app posts its opaque browse ID and params to web `browse` and
reads the plain lyrics shelf. Native YouTube plain text takes precedence over
earlier external plain text when both exist. InnerTube authentication errors and cancellation
remain visible to the caller. External providers receive only the track
metadata needed to match lyrics; no Google cookies or authorization values
are sent there.

The public model represents both timed lines and manually scrolled plain
lines. Cue times are converted from milliseconds to seconds; invalid or
non-finite cue ranges are rejected. Timed lines are sorted by cue start, with
received order preserving ties. A cue can be active only within its interval.
The UI decides whether to auto-follow a timed
line; it must not auto-scroll plain lyrics. Unexpected JSON envelopes or bad
cue fields throw `InnerTubeError.invalidResponse`; a recognized empty lyrics
response returns `nil`. Cancellation propagates between requests.

The mobile profile, response layout, and source attribution field are
undocumented and may change. Update `LyricsResponseParser` using a smallest
possible sanitized fixture when a live response changes. The fixture-based
tests in `LyricsResponseParserTests` use synthetic text and identifiers; no
copyrighted song lyrics or account response is retained. AuraMusic's GPL-3.0
code was consulted for behavior, not copied.