diff --git a/CHANGES.md b/CHANGES.md index c64da99..c3e1580 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/spotdl/lyrics/providers/genius.py b/spotdl/lyrics/providers/genius.py index 49d7f53..399b690 100644 --- a/spotdl/lyrics/providers/genius.py +++ b/spotdl/lyrics/providers/genius.py @@ -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()