50 lines
822 B
Python
50 lines
822 B
Python
from dataclasses import dataclass
|
|
from typing import Union
|
|
|
|
|
|
@dataclass
|
|
class LyricsResult:
|
|
"""
|
|
Class for returned Lyrics Results
|
|
Attributes:
|
|
artist (str): returned artist
|
|
song (str): returned song
|
|
src (str): source result was fetched from
|
|
lyrics (Union[str, list]): str if plain lyrics, list for lrc
|
|
time (float): time taken to retrieve lyrics from source
|
|
"""
|
|
|
|
artist: str
|
|
song: str
|
|
src: str
|
|
lyrics: Union[str, list]
|
|
confidence: int
|
|
time: float = 0.00
|
|
|
|
|
|
"""
|
|
Generic
|
|
"""
|
|
|
|
|
|
class InvalidLyricSearchResponseException(Exception):
|
|
pass
|
|
|
|
|
|
"""
|
|
Genius
|
|
"""
|
|
|
|
|
|
class InvalidGeniusResponseException(InvalidLyricSearchResponseException):
|
|
pass
|
|
|
|
|
|
"""
|
|
LRCLib
|
|
"""
|
|
|
|
|
|
class InvalidLRCLibResponseException(InvalidLyricSearchResponseException):
|
|
pass
|