[WS] Genius (Lyrics)

If you get this error the search string probably is not correct for Genius.
Have a look at the url which you see for this track on the genius-website and compare it to the search string that Mp3tag uses for search. You can correct that in Mp3tag manually.

You used the JSON-version. There are different remarks in this thread, but the JSON-version does not work for me. I get no results for lyrics. The HTML-Version works here.

That was it, thank you. In my example I had the artist as “David Bowie, Nine Inch Nails” but Genius.com doesn’t have NIN included, so removing that from the search URL allowed the lyrics to be found.

same issue here, it seems that this plugin doesn’t support Mac

First, thank you for this script! It works great generally, but I also ran into issues when running it on Mac.

The Problem: When the script attempts to generate the Genius URL, the regex engine on the Mac version fails to parse the complex "featuring/stripping" pattern in the .src file. Instead of a clean URL, it generates a URL containing the error message itself:

https://genius.com/Artist-invalid-regular-expression-s-ft-feat-featuring-prod-remix-radio-s-s-lyrics

The Cause: The issue lies in Genius#Lyrics.src. The regular expression used to remove "feat.", "prod.", and "remix" information from the title is too complex for the Mac implementation (specifically the nested character classes [[({]).

The Solution: I have rewritten the .src file to use a simplified regex that is compatible with Mac while still correctly stripping the necessary data to generate the correct slug.

Here is the fixed code for Genius#Lyrics.src:

Genius#Lyrics.src (1.3 KB)

Technical Detail of the Fix: I replaced the failing regex: ^(.+?)\s+[[({]?(?:ft\.?|feat\.?|featuring\.?|prod.?|remix.?|radio\.?)\s+(?:[^][(){}]+)[])}]?(\s+.+)?$

With this Mac-safe version: \s+[\(\[](?:ft|feat|featuring|prod|remix|radio).*

I have tested this updated script with just a few songs for now, but wanted to share this in case it helps other Mac users!

1 Like

I also made personal adjustments to the script:

In my music library, featured artists are in the artist tag in the form of “Danny Brown feat. Jane Remover” or even “Danny Brown, Jane Remover”, not the song tag. This updated script now searches both the artist and song tags to remove the unnecessary information from the URL. And it works on Mac like the version above.

Genius#Lyrics.src (1.4 KB)

I’ve run into the problem that the script doesn’t import the songwriter & producer credits anymore. Does somebody have a fix for this?