mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 03:52:51 +01:00
added null check for genius lyrics scrape
This commit is contained in:
parent
939bc269b8
commit
8e28f0b694
1 changed files with 7 additions and 1 deletions
|
|
@ -373,7 +373,13 @@ class Genius(Backend):
|
|||
|
||||
# At least Genius is nice and has a tag called 'lyrics'!
|
||||
# Updated css where the lyrics are based in HTML.
|
||||
lyrics = html.find("div", class_="lyrics").get_text()
|
||||
try:
|
||||
lyrics = html.find("div", class_="lyrics").get_text()
|
||||
except AttributeError as exc:
|
||||
# html is a NoneType cannot retrieve lyrics
|
||||
self._log.debug(u'Genius lyrics for {0} not found: {1}',
|
||||
page_url, exc)
|
||||
return None
|
||||
|
||||
return lyrics
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue