Repository: beetbox/beets

Issue:
lyrics: Polish comments appear in text of lyrics
When downloading lyrics for songs there is Polish text appearing at the top and bottom of the text.  This text is saved into the mp3.  It seems like this should be resolved with something like the remove_credits() function.

When lyrics are downloaded the text
```
Tekst piosenki:
```
appears at the top of the lyrics. [Translates to "lyrics"]

Additionally, the text
```
Dodaj interpretację do tego tekstu »

Historia edycji tekstu
```
appears at the bottom of the text. [Translates to "add interpretation to this text" and "history of the text editing"]

This appears on every lyrics downloaded.

This was mentioned in issues https://github.com/beetbox/beets/issues/3904 and https://github.com/beetbox/beets/issues/4043 as side issues, but since it was never fixed I am opening this issue in hopes that it will be addressed.


### Problem

Running this command in verbose (`-vv`) mode:

```sh
$ beet -vv lyrics -p Papercut
user configuration: /home/<USER>/.config/beets/config.yaml
data directory: /home/<USER>/.config/beets
plugin paths:
ImageMagick version check failed: [Errno 2] No such file or directory: 'magick': 'magick'
artresizer: method is (2, (6, 9, 7), True)
lyrics: Disabling google source: no API key configured.
lastgenre: Loading canonicalization tree /home/<USER>/.local/lib/python3.6/site-packages/beetsplug/lastgenre/genres-tree.yaml
Sending event: pluginload
library database: /media/audio/DBs/beets_musiclibrary.db
library directory: /media/audio/Music_Collection
Sending event: library_opened
lyrics: lyrics already present: AAC 256kbps  2:36  02/06  Rap	JAY‐Z & Linkin Park	2004Collision Course	Big Pimpin’ / Papercut
Tekst piosenki:
Hahaha, wasting your talent Randy!
Yeah, you're ready?

[SNIP - full text of lyrics removed for brevity]

We doin'... big pimpin' up in N.Y.C.
It's just that Jigga Man, Pimp C, and B.U.N.B-B-B
Dodaj interpretację do tego tekstu »

Historia edycji tekstu
Sending event: cli_exit

```

Led to this problem:

Extraneous lines in lyrics text:
```
Tekst piosenki:
Dodaj interpretację do tego tekstu »
Historia edycji tekstu
```


Here's a link to the music files that trigger the bug (if relevant):

It happens with every music file.

### Setup
This happens on both Mac and Linux computers:
```
* OS: Mac OS 10.14.6 (Mojave)
* Python version: 3.9.8
* beets version: 1.6.0
* Turning off plugins made problem go away (yes/no): no, it is a plugin issue
```

```
* OS: Linux Ubuntu 18.04.6 LTS (Bionic Beaver)
* Python version: 3.6.9
* beets version: 1.6.0
* Turning off plugins made problem go away (yes/no): no, it is a plugin issue
```


My configuration (output of `beet config`) is:

```yaml
lyrics:
    bing_lang_from: []
    auto: no
    force: no
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    local: no
    sources:
    - google
    - musixmatch
    - genius
    - tekstowo

```



Discussion:

Resolving patch:
diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py
--- a/beetsplug/lyrics.py
+++ b/beetsplug/lyrics.py
@@ -419,11 +419,17 @@ def _scrape_lyrics_from_html(self, html):
             lyrics_div = verse_div.parent
             for br in lyrics_div.find_all("br"):
                 br.replace_with("\n")
+
             ads = lyrics_div.find_all("div",
                                       class_=re.compile("InreadAd__Container"))
             for ad in ads:
                 ad.replace_with("\n")
 
+            footers = lyrics_div.find_all("div",
+                                          class_=re.compile("Lyrics__Footer"))
+            for footer in footers:
+                footer.replace_with("")
+
         return lyrics_div.get_text()
 
 
@@ -488,11 +494,11 @@ def extract_lyrics(self, html):
         if not soup:
             return None
 
-        lyrics_div = soup.find("div", class_="song-text")
+        lyrics_div = soup.select("div.song-text > div.inner-text")
         if not lyrics_div:
             return None
 
-        return lyrics_div.get_text()
+        return lyrics_div[0].get_text()
 
 
 def remove_credits(text):


Test patch: