kudos/combine.fm

Google Play Music EOL

Closed this issue · 1 comments

L-P commented

Google Play Music will join the Google Graveyard before 2020 ends.

This means a new service for its replacement, Youtube Music, must be added.
There is no publicly documented API but some effort was put in a thoroughly documented python library (ytmusicapi) which could greatly help in implementing the few calls combine.fm should need.
It seems there is no need for authentication to perform searches.

This task is up for grabs, I might find the motivation next time I need to share a track.

I've been looking into this tonight and I found out some stuff.

  1. Songs
    When you click on the "share" button from a song, ytmusic gives an url like this one: https://music.youtube.com/watch?v=YLp2cW7ICCU&feature=share, this is very similar to a youtube url. This id we get from parsing this url, YLp2cW7ICCU, can be used in the get_song method from the ytmusicapi to get back information about a song. My impression is that we have all info we need there, no need for signups or tokens :)

  2. Albums (easy one)
    You can browse an album using the https://music.youtube.com/browse/MPREb_9C36yscfgmJ url. The id after /browse, MPREb_9C36yscfgmJ again, can be used in the get_album method and once more it seems to me we have all info we might need there, and again, no need for signups or tokens :)

  3. Albums (tricky one)
    When you click the "share" button for an album, you get an url that looks like https://music.youtube.com/playlist?list=OLAK5uy_lx9K5RpiBEwd3E4C1GKqY7e06qTlwydvs. Now, you can use that on the get_watch_playlist_shuffle method and it will give you a whole playlist. If you open that url with js enabled, the path gets converted onto that previous one, the easy one. I couldn't find a way to jump from one to the other, it seems the album url comes in some json that's loaded by the ytmusic app and so on. One way I could deal with that one is to parse the playlist and if all songs match one album, fallback to the previous method.

I haven't yet started looking into the search methods. But I'll finish up writing the parse for the first two parts and open a PR :)