mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Merge pull request #654 from ritiek/fix-genius-lyric-crash
Fix crash when lyrics not yet released on Genius
This commit is contained in:
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Fixed a crash occuring when lyrics for a track are not yet released
|
||||
on Genius ([@ritiek](https://github.com/ritiek)) (#654)
|
||||
- Fixed a regression where a track would fail to download if it isn't
|
||||
found on Spotify ([@ritiek](https://github.com/ritiek)) (#653)
|
||||
|
||||
|
||||
@@ -37,8 +37,10 @@ class Genius(LyricBase):
|
||||
def _get_lyrics_text(self, html):
|
||||
soup = BeautifulSoup(html, "html.parser")
|
||||
lyrics_paragraph = soup.find("p")
|
||||
lyrics = lyrics_paragraph.get_text()
|
||||
return lyrics
|
||||
if lyrics_paragraph:
|
||||
return lyrics_paragraph.get_text()
|
||||
else:
|
||||
raise LyricsNotFound("The lyrics for this track are yet to be released.")
|
||||
|
||||
def get_lyrics(self, linesep="\n", timeout=None):
|
||||
url = self._guess_lyric_url()
|
||||
|
||||
Reference in New Issue
Block a user