beets
beets copied to clipboard
lyrics: Detect and follow redirected artist names in LyricsWiki
Problem
Looks like the lyrics plugin does not know how to handle artist pages that are redirected. Ytcracker redirects to YTCracker, but when linking a song using the former capitalization it does not redirect properly. This could probably be partially an issue with Lyrics Wiki, since it seems like it'd make more sense for them to redirect instead.
Maybe the Lyrics plugin can somehow check the validity of the artist name afterwards if it fails?
Running this command in verbose (-vv) mode:
$ beet -vv lyrics the beginning ytcracker
Led to this problem:
lyrics: failed to fetch: http://lyrics.wikia.com/Ytcracker:The_Beginning (404)
Setup
- OS: Archlinux
- Python version: 3.6
- beets version: 1.4.3
- Turning off plugins made problem go away (yes/no): N/A
My configuration (output of beet config) is: N/A
Hmm; interesting! Yes, the plugin just tries to fetch that one URL (http://lyrics.wikia.com/Ytcracker:The_Beginning). In what capacity are you seeing the redirect? It looks like that URL does indeed show a "not found" page; is there a different page somewhere where we can look for the corrected URL?
@sampsyo The correct link is (http://lyrics.wikia.com/wiki/YTCracker:The_Beginning). If you go to (http://lyrics.wikia.com/wiki/Ytcracker) it shows the contents of the correct page (http://lyrics.wikia.com/wiki/YTCracker) but also "Redirected from Ytcracker" however the URL doesn't actually change. On Ytcracker it shows the following line: #REDIRECT [[YTCracker]]
I see. So the redirect is available on the artist page, but not on the individual, per-song pages.
It sounds like the only way to do this would be, whenever we get a 404 error, to do a second request for the artist page. If that succeeds and gives us a new artist name, we'll then need to do a third request to the server to get the correct per-song page. That's too bad and will slow things down, but I suppose at least the cost will only be incurred for songs that 404 initially.
Thanks for the extra details!
No problem! It is too bad that it will make things slower, but perhaps there can be a configuration option to skip checking the artist redirects? Not sure how large the performance hit would be, but it is potentially 2 additional requests which could add some time initially for larger collections since it will affect all songs for any artist that has this issue.