Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lyrics: Try searching for song title component preceding : to strip subtitles #2205

Closed
gderber opened this issue Sep 22, 2016 · 4 comments
Closed
Labels
feature features we would like to implement

Comments

@gderber
Copy link

gderber commented Sep 22, 2016

Problem

The lyrics plugin fails to find the lyrics for titles that have a "subtitle" for example:
The musicbrainz artist - album - title
Nightwish - Endless Forms Most Beautiful - The Greatest Show on Earth: Chapter I) Four Point Six / Chapter II) Life / Chapter III) The Toolmaker / Chapter IV) The Understanding / Chapter V) Sea-Worn Driftwood
musicbrainz page for this song: https://musicbrainz.org/recording/42854595-599c-438d-b3f5-0be264d41ccb

Corresponds to lyricwiki title:
Nightwish - Endless Forms Most Beautiful - The Greatest Show on Earth
Lyricwiki page: http://lyrics.wikia.com/wiki/Nightwish:The_Greatest_Show_On_Earth

Basically, everything after the ":" needs to be dropped before searching.

This also applies to Pink Floyd - Atom Heart Mother - Atom Heart Mother: a) Father’s Shout / b) Breast Milky / c) Mother Fore / d) Funky Dung / e) Mind Your Throats Please / f) Remergence
Running this command in verbose (-vv) mode:

$ beet -vv lyrics -f albumartist:Nightwish album:Endless title:Greatest

Led to this problem:


user configuration: /home/user/.config/beets/config.yaml
data directory: /home/user/.config/beets
plugin paths: /home/user/.beets/beets-setlister/beetsplug
Sending event: pluginload
lyrics: Disabling google source: no API key configured.
inline: adding item field multidisc
inline: adding item field lmultidisc
artresizer: method is (2, (6, 8, 9))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
library database: /home/geoff/.config/beets/library.db
library directory: /home/geoff/Music
Sending event: library_opened
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six_/_Chapter_Ii%29_Life_/_Chapter_Iii%29_The_Toolmaker_/_Chapter_Iv%29_The_Understanding_/_Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six-/-Chapter-Ii%29-Life-/-Chapter-Iii%29-The-Toolmaker-/-Chapter-Iv%29-The-Understanding-/-Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Ii%29_Life (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Ii%29-Life (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iii%29_The_Toolmaker (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iii%29-The-Toolmaker (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iv%29_The_Understanding (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iv%29-The-Understanding (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: lyrics not found: Nightwish - Endless Forms Most Beautiful - 11. The Greatest Show on Earth: Chapter I) Four Point Six / Chapter II) Life / Chapter III) The Toolmaker / Chapter IV) The Understanding / Chapter V) Sea-Worn Driftwood (24:01)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six_/_Chapter_Ii%29_Life_/_Chapter_Iii%29_The_Toolmaker_/_Chapter_Iv%29_The_Understanding_/_Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six-/-Chapter-Ii%29-Life-/-Chapter-Iii%29-The-Toolmaker-/-Chapter-Iv%29-The-Understanding-/-Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Ii%29_Life (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Ii%29-Life (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iii%29_The_Toolmaker (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iii%29-The-Toolmaker (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iv%29_The_Understanding (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iv%29-The-Understanding (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: lyrics not found: Nightwish - Endless Forms Most Beautiful - 11. The Greatest Show on Earth: Chapter I) Four Point Six / Chapter II) Life / Chapter III) The Toolmaker / Chapter IV) The Understanding / Chapter V) Sea-Worn Driftwood (24:08)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six_/_Chapter_Ii%29_Life_/_Chapter_Iii%29_The_Toolmaker_/_Chapter_Iv%29_The_Understanding_/_Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six-/-Chapter-Ii%29-Life-/-Chapter-Iii%29-The-Toolmaker-/-Chapter-Iv%29-The-Understanding-/-Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:The_Greatest_Show_On_Earth%3A_Chapter_I%29_Four_Point_Six (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/The-Greatest-Show-On-Earth%3A-Chapter-I%29-Four-Point-Six (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Ii%29_Life (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Ii%29-Life (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iii%29_The_Toolmaker (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iii%29-The-Toolmaker (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_Iv%29_The_Understanding (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-Iv%29-The-Understanding (404)
lyrics: failed to fetch: http://lyrics.wikia.com/Nightwish:Chapter_V%29_Sea-Worn_Driftwood (404)
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Nightwish/Chapter-V%29-Sea-Worn-Driftwood (404)
lyrics: lyrics not found: Nightwish - Endless Forms Most Beautiful - 09. The Greatest Show on Earth: Chapter I) Four Point Six / Chapter II) Life / Chapter III) The Toolmaker / Chapter IV) The Understanding / Chapter V) Sea-Worn Driftwood (23:36)
Sending event: cli_exit

Here's a link to the music files that trigger the bug (if relevant):

Setup

  • OS: Linux
  • Python version:
  • beets version: 1.3.19
  • Turning off plugins made problem go away (yes/no): no
@sampsyo sampsyo changed the title lyrics doesn't find lyrics when the title name has subtitles. lyrics: Try searching for song title component preceding : to strip subtitles Sep 23, 2016
@sampsyo sampsyo added the feature features we would like to implement label Sep 23, 2016
@sampsyo
Copy link
Member

sampsyo commented Sep 23, 2016

Thanks for the detailed documentation! Seems like a good idea to try searching for the pre-colon part of the title.

@gderber
Copy link
Author

gderber commented Sep 23, 2016

To make this more complicated than I initially thought, I found a counter example that needs the information post colon.

Credits T Judd - I Stoled This Record - Skoal: The Grundy County Spitting Incident
Musicbrainz page: https://musicbrainz.org/recording/69375f22-2c82-4470-906c-c0916ea28a97
LyricWiki page: http://lyrics.wikia.com/wiki/Cledus_T._Judd:Skoal:_The_Grundy_County_Spitting_Incident

Without the information after the:
beet -vv lyrics -f artist:Cledus title:Skoal
user configuration: /home/user/.config/beets/config.yaml
data directory: /home/user/.config/beets
plugin paths: /home/user/.beets/beets-setlister/beetsplug
Sending event: pluginload
artresizer: method is (2, (6, 8, 9))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
lyrics: Disabling google source: no API key configured.
inline: adding item field multidisc
inline: adding item field lmultidisc
library database: /home/user/.config/beets/library.db
library directory: /home/user/Music
Sending event: library_opened
lyrics: failed to fetch: https://www.musixmatch.com/lyrics/Cledus-T.-Judd/Skoal (404)
lyrics: lyrics not found: Cledus T. Judd - I Stoled This Record - 05. Skoal (2:24)
Sending event: cli_exit

With the information after the colon:
beet -vv lyrics -f artist:Cledus title:Skoal
user configuration: /home/user/.config/beets/config.yaml
data directory: /home/user/.config/beets
plugin paths: /home/user/.beets/beets-setlister/beetsplug
Sending event: pluginload
artresizer: method is (2, (6, 8, 9))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
lyrics: Disabling google source: no API key configured.
inline: adding item field multidisc
inline: adding item field lmultidisc
library database: /home/geoff/.config/beets/library.db
library directory: /home/geoff/Music
Sending event: library_opened
lyrics: got lyrics from backend: LyricsWiki
lyrics: fetched lyrics: Cledus T. Judd - I Stoled This Record - 05. Skoal: The Grundy County Spitting Incident (2:24)

So I am thinking the fix might be something along the lines of
if [[lyrics not found]] && [[ title contains ":" ]] then
Title=title without everything post colon.
Attempt lyrics download again.


I did find yet another case that is even more complicated, and I don't have any ideas on how to code it.

Nightwish - Angels Fall First - Lappi (Lapland): I. Erämaajärvi
Nightwish - Angels Fall First - Lappi (Lapland): II. Witchdrums
Nightwish - Angels Fall First - Lappi (Lapland): III. This Moment Is Eternity
Nightwish - Angels Fall First - Lappi (Lapland): IV. Etiäinen

Musicbrainz album page, tracks 9-12: https://musicbrainz.org/release/2756c819-b6d7-3052-9ff8-8c05e65eb5df
All correspond to a single LyricWiki entry:
http://lyrics.wikia.com/wiki/Nightwish:Lappi_(Lapland)

Stripping the information after the colon would download the lyrics, but for all songs. I don't see a clean way to only download the lyrics for a single song. Maybe this last case should be it's own bug.

@sampsyo
Copy link
Member

sampsyo commented Sep 23, 2016

Thanks! @Kraymer has a fix that works for the first case, at least, by trying the title both with and without a subtitle.

@gderber
Copy link
Author

gderber commented Sep 24, 2016

Thank you. I hope I provided enough information to fix not finding lyrics in one case without breaking finding lyrics in another case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

No branches or pull requests

2 participants