mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
The following inputs can now be used to fetch lyrics: * artist and track names * search query * direct url
37 lines
867 B
Python
37 lines
867 B
Python
import lyricwikia
|
|
|
|
from abc import ABC
|
|
from abc import abstractmethod
|
|
|
|
|
|
class LyricBase(ABC):
|
|
"""
|
|
Defined lyric providers must inherit from this abstract base
|
|
class and implement their own functionality for the below
|
|
defined methods.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def from_url(self, url, linesep="\n", timeout=None):
|
|
"""
|
|
This method must return the lyrics string for the
|
|
given track.
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def from_artist_and_track(self, artist, track, linesep="\n", timeout=None):
|
|
"""
|
|
This method must return the lyrics string for the
|
|
given track.
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def from_query(self, query, linesep="\n", timeout=None):
|
|
"""
|
|
This method must return the lyrics string for the
|
|
given track.
|
|
"""
|
|
pass
|