from __future__ import annotations import re from dataclasses import dataclass Seconds = float @dataclass class Metadata: name: str value: str @dataclass class Subtitle: text: str start: Seconds end: Seconds | None = None def parse_lrc(text): for line in text.split('\n'): times = [] while mobj := re.fullmatch(r'\[(?P