linsomniac/spotify_to_ytmusic

How to favour explicit versions of songs?

Closed this issue · 4 comments

I have a huge playlist full of songs that whilst for the most part, this converter does a better job then online converters at converting the uncensored versions, there's still a decent chunk (I'd say close to 25%) that will be converted as the censored versions instead which makes a lot of these songs unlistenable.

Is there anyway with the Youtube Music API to search only for explicit songs?, if not I wonder what's another way to distinguish from them.

This is a bit tricky, ytmusic doesn't really have a "if there's a clean and explicit version of this song, prefer the explicit" search method. So it would require some heuristics to achieve. Can you provide a few example song/artist combinations?

One option might be for the lookup algorithm to look at the "search suggestions" and see if it looks like people often look for an explicit or a clean version. For example, WAP by Cardi B has search suggestions of:

  • wap by cardi b
  • wap by cardi b not clean
  • wap by cardi b lyrics
  • wap by cardi b karaoke
  • wap by cardi b clean
  • wap by cardi b and megan thee stallion
  • the wap song by cardi b

That's an extreme case though, there are much more benign cases that just don't come right to mind to me where they drop an F-bomb in the song that might have a different suggestion profile.

The returned songs do have an "isExplicit" flag, so one option would be to do something like look at the first two responses and if they are very similar but one is explicit and one is not, prefer the explicit (or likewise: allow an option for preferring non-explicit). In the case of WAP, the first response is explicit and the second is not but they both are the correct song.

Remember, the search is extremely fuzzy, it's like doing a google search rather than doing a database search. I first do an "album search" for " by ", and then look for a song within that by name as an exact match. If that doesn't work, then I search for " by ". YTMusic seems to be pretty good about giving a good first result, but it doesn't at all mean that the responses will be just for this song. For example, the 4th hit I get for "WAP" is an entirely other song by Cardi B.

So, yes, there might be some options here, but it's going to be tricky.

Aside: I did modify "s2yt_search" to display the returned suggestions as well as the top 5 results, so you can play around a little bit and see what data ytmusic is returning.

So it would require some heuristics to achieve. Can you provide a few example song/artist combinations?

Multiple examples from classic Eminem albums, such as "The Eminem Show", "Marshall Mathers LP" or others in the same time period.

The returned songs do have an "isExplicit" flag, so one option would be to do something like look at the first two responses and if they are very similar but one is explicit and one is not, prefer the explicit (or likewise: allow an option for preferring non-explicit). In the case of WAP, the first response is explicit and the second is not but they both are the correct song.

I thought about tackling this idea with a explicit only switch or taking track data from Spotify and seeing if it is a explicit track, only hypothetical have not looked into the API as of yet.

Now that I am back from holiday I will play around with the idea and draft out some changes and see if it feasible, a bruteforce explicit only toggle is undesirable so working with the data that comes from Spotify if its even possible in the first place might be the best bet.

Aside: I did modify "s2yt_search" to display the returned suggestions as well as the top 5 results, so you can play around a little bit and see what data ytmusic is returning.

That's actually really useful, I'll use that alongside matching Spotify data and see what I can come up with. Cheers.