Scrape lyrics from Genius and lyrics refactor

This commit is contained in:
Ritiek Malhotra
2019-07-22 15:55:05 +05:30
parent 341af5bce9
commit 0d846cdcce
10 changed files with 162 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
import lyricwikia
from spotdl.lyrics.lyric_base import LyricBase
from spotdl.lyrics.exceptions import LyricsNotFound
class LyricWikia(LyricBase):
def __init__(self, artist, song):
self.artist = artist
self.song = song
def get_lyrics(self, linesep="\n", timeout=None):
try:
lyrics = lyricwikia.get_lyrics(self.artist, self.song, linesep, timeout)
except lyricwikia.LyricsNotFound as e:
raise LyricsNotFound(e.args[0])
else:
return lyrics