mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 01:25:47 +01:00
Merge pull request #3901 from Ubiquitine/patch-1
Fix for Musixmatch multi-part lyrics
This commit is contained in:
commit
2fa2d1b4ee
2 changed files with 11 additions and 2 deletions
|
|
@ -291,14 +291,21 @@ class MusiXmatch(Backend):
|
|||
self._log.warning(u'we are blocked at MusixMatch: url %s failed'
|
||||
% url)
|
||||
return
|
||||
html_part = html.split('<p class="mxm-lyrics__content')[-1]
|
||||
lyrics = extract_text_between(html_part, '>', '</p>')
|
||||
html_parts = html.split('<p class="mxm-lyrics__content')
|
||||
# Sometimes lyrics come in 2 or more parts
|
||||
lyrics_parts = []
|
||||
for html_part in html_parts:
|
||||
lyrics_parts.append(extract_text_between(html_part, '>', '</p>'))
|
||||
lyrics = '\n'.join(lyrics_parts)
|
||||
lyrics = lyrics.strip(',"').replace('\\n', '\n')
|
||||
# another odd case: sometimes only that string remains, for
|
||||
# missing songs. this seems to happen after being blocked
|
||||
# above, when filling in the CAPTCHA.
|
||||
if "Instant lyrics for all your music." in lyrics:
|
||||
return
|
||||
# sometimes there are non-existent lyrics with some content
|
||||
if 'Lyrics | Musixmatch' in lyrics:
|
||||
return
|
||||
return lyrics
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ Other new things:
|
|||
|
||||
Fixes:
|
||||
|
||||
* :bug:`/plugins/lyrics`: Fixed Musixmatch fetch lyrics divided into multiple elements on the web-page
|
||||
* :bug:`/plugins/lyrics`: Fixed Musixmatch fetch for non-existing lyrics
|
||||
* :bug:`/plugins/web`: Allow use of backslash in regex web queries.
|
||||
:bug:`3867`
|
||||
* :bug:`/plugins/web`: Fixed a small bug which caused album artpath to be
|
||||
|
|
|
|||
Loading…
Reference in a new issue