beetbox / beetbox/beets

MusixMatch server ignore requests with beets user agent

Open
#2,546 9 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

With user agent :

```sh
$ export BEETS_TEST_LYRICS_SOURCES=1
$ nosetests -s -v test/test_lyrics.py
$ ======================================================================
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 << --------------------
[...]
requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): www.musixmatch.com
requests.packages.urllib3.connectionpool: DEBUG: https://www.musixmatch.com:443 "GET /lyrics/Santana/Black-Magic-Woman HTTP/1.1" 404 11
beets.lyrics: DEBUG: lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Santana/Black-Magic-Woman (404)
```

After setting empty `''` user agent :

```
======================================================================
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', 'Genius'] is not false
-------------------- >> begin captured logging << --------------------
[...]
requests.packages.urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): www.musixmatch.com
requests.packages.urllib3.connectionpool: DEBUG: https://www.musixmatch.com:443 "GET /lyrics/Santana/Black-Magic-Woman HTTP/1.1" 200 25146
```

Contributor guide

Open the contributing guide

Research direction

Start with test/test_lyrics.py and reproduce the MusiXmatch request using the shown beets user agent and an empty user agent. Trace the MusiXmatch backend request path and verify that the resulting test passes while LyricsCom and Genius remain represented in the existing backend-source checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.