ytmusicapi.models package

Submodules

ytmusicapi.models.lyrics module

class ytmusicapi.models.lyrics.LyricLine(text: str, start_time: int, end_time: int, id: int) None

Bases: object

Represents a line of lyrics with timestamps (in milliseconds).

Args:

text (str): The Songtext. start_time (int): Begin of the lyric in milliseconds. end_time (int): End of the lyric in milliseconds. id (int): A Metadata-Id that probably uniquely identifies each lyric line.

end_time: int
classmethod from_raw(raw_lyric: dict)

Converts lyrics in the format from the api to a more reasonable format

Parameters:

raw_lyric (dict) – The raw lyric-data returned by the mobile api.

Return LyricLine:

A LyricLine

id: int
start_time: int
text: str
class ytmusicapi.models.lyrics.Lyrics

Bases: TypedDict

hasTimestamps: Literal[False]
lyrics: str
source: Optional[str]
class ytmusicapi.models.lyrics.TimedLyrics

Bases: TypedDict

hasTimestamps: Literal[True]
lyrics: list[LyricLine]
source: Optional[str]

Module contents

class ytmusicapi.models.LyricLine(text: str, start_time: int, end_time: int, id: int) None

Bases: object

Represents a line of lyrics with timestamps (in milliseconds).

Args:

text (str): The Songtext. start_time (int): Begin of the lyric in milliseconds. end_time (int): End of the lyric in milliseconds. id (int): A Metadata-Id that probably uniquely identifies each lyric line.

end_time: int
classmethod from_raw(raw_lyric: dict)

Converts lyrics in the format from the api to a more reasonable format

Parameters:

raw_lyric (dict) – The raw lyric-data returned by the mobile api.

Return LyricLine:

A LyricLine

id: int
start_time: int
text: str
class ytmusicapi.models.Lyrics

Bases: TypedDict

hasTimestamps: Literal[False]
lyrics: str
source: Optional[str]
class ytmusicapi.models.TimedLyrics

Bases: TypedDict

hasTimestamps: Literal[True]
lyrics: list[LyricLine]
source: Optional[str]