mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2026-01-02 07:26:39 +00:00
Scrape lyrics from Genius and lyrics refactor
This commit is contained in:
18
spotdl/lyrics/providers/lyricwikia_wrapper.py
Normal file
18
spotdl/lyrics/providers/lyricwikia_wrapper.py
Normal 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
|
||||
Reference in New Issue
Block a user