beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.69k stars 1.81k forks source link

Genius lyrics backend fails on request error #2545

Closed Kraymer closed 6 years ago

Kraymer commented 7 years ago

Problem

Can't make the genius backend work.

Running this command in verbose (-vv) mode:

$ export BEETS_TEST_LYRICS_SOURCES=1
$ nosetests -s -v test/test_lyrics.py

Led to this problem:

======================================================================
FAIL: Test default backends with songs known to exist in respective databases.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/flap/Dev/beets/test/test_lyrics.py", line 316, in test_backend_sources_ok
    self.assertFalse(errors)
AssertionError: ['LyricsCom', 'MusiXmatch', 'Genius'] is not false
-------------------- >> begin captured logging << --------------------
[...]
beets.lyrics: DEBUG: lyrics: genius: requesting search https://api.genius.com/search?q=The%20Beatles%20Lady%20Madonna
requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): api.genius.com
requests.packages.urllib3.connectionpool: DEBUG: https://api.genius.com:443 "GET /search?q=The%20Beatles%20Lady%20Madonna HTTP/1.1" 200 None
beets.lyrics: DEBUG: lyrics: genius: requesting lyrics for link https://genius.com/The-beatles-lady-madonna-lyrics
requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): genius-api.com
beets.lyrics: DEBUG: lyrics: genius: request error: HTTPConnectionPool(host='genius-api.com', port=80): Max retries exceeded with url: /api/lyricsInfo (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x104b29590>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 17 tests in 15.582s

FAILED (failures=1)

Setup

My configuration (output of beet config) is:

lyrics:
    sources: google lyricwiki lyrics.com genius
sampsyo commented 7 years ago

Yep, our source—genius-api.com—seems to be defunct. We can either remove the source or switch to screen-scraping the official genius.com pages.