mirror of
https://github.com/beetbox/beets.git
synced 2026-02-09 17:01:55 +01:00
Remove extract_text_between
This commit is contained in:
parent
55b7824948
commit
54fc67b30a
1 changed files with 1 additions and 10 deletions
|
|
@ -127,15 +127,6 @@ def close_session():
|
|||
# Utilities.
|
||||
|
||||
|
||||
def extract_text_between(html, start_marker, end_marker):
|
||||
try:
|
||||
_, html = html.split(start_marker, 1)
|
||||
html, _ = html.split(end_marker, 1)
|
||||
except ValueError:
|
||||
return ""
|
||||
return html
|
||||
|
||||
|
||||
def search_pairs(item):
|
||||
"""Yield a pairs of artists and titles to search for.
|
||||
|
||||
|
|
@ -448,7 +439,7 @@ class MusiXmatch(DirectBackend):
|
|||
# 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_parts.append(re.sub(r"^[^>]+>|</p>.*", "", html_part))
|
||||
lyrics = "\n".join(lyrics_parts)
|
||||
lyrics = lyrics.strip(',"').replace("\\n", "\n")
|
||||
# another odd case: sometimes only that string remains, for
|
||||
|
|
|
|||
Loading…
Reference in a new issue