gmusicproxy / gmusicproxy

Google Play Music Proxy - "Let's stream Google Play Music using any media-player"
https://gmusicproxy.github.io
GNU General Public License v3.0
311 stars 54 forks source link

Can't stream free radio stations with a non-subscriber account #92

Open NonaSuomy opened 7 years ago

NonaSuomy commented 7 years ago
  File "/usr/lib/python2.7/site-packages/gmusicapi/clients/mobileclient.py", line 384, in get_stream_url
    raise NotSubscribed("Store tracks require a subscription to stream.")
NotSubscribed: Store tracks require a subscription to stream. (https://goo.gl/v1wVHT)

This works fine in others use of gmusicapi (kodi)

Any way to support this function or am I just typing the wrong thing to pull one of the free radio stations

http://10.13.37.42:9999/get_station?id=bde8a9a0-1417-373f-b286-22d106b08c32

It grabs the tracklist of 50 mp3's but then dumps the message above.

mario-tux commented 7 years ago

The provided URL doesn't work for me. How did you search the id for free radios?

NonaSuomy commented 7 years ago

Hi @diraimondo

http://10.13.37.42:9999/get_all_stations

I think those ID's are generated for your personal account.

You might have to listen to some of the free stations first that google got from when they bought songza.

Which then seems to populate them to that get_all_stations list as the ones I mainly listen to were all in there, would be nice as well if you could add a command to browse the free station lists.

Usually, the station names are based on activities like "relaxing" https://play.google.com/music/listen#/situations/Nujfc6muvmopflrnotbpjhto5ou and situations like "indie dance party" https://play.google.com/music/listen#/wst/situations/Ly2qbctvououx22y5cn2a34y3ku , artists like "Paramore" https://play.google.com/music/listen#/wst/artist/Awioa52yrttxbtc57ged6joexeq names then they give you a bunch of stuff to listen to that are similar artists (probably how the paid AA service work but instead of downloading mp3 maybe it only gives a streaming only station links?)

Basically, any free accounts can listen to the technology they bought from songza and integrated it into google music.

NonaSuomy commented 7 years ago

it also has a skipping feature built-in for the free accounts, you can skip up to 6 songs per hour on station loads. (Which was also supported by that python kodi addon script)

"When you're listening to free radio stations, you can skip up to 6 songs per hour.

When you're nearing your skip limit, you'll see a notification with the option to subscribe to Google Play Music. If you choose to subscribe, you'll get unlimited skips and ad-free access to over 30 million songs."

Information link below.

NonaSuomy commented 7 years ago

https://support.google.com/googleplay/answer/6230658?hl=en

mario-tux commented 7 years ago

I live in Italy so I can't test this feature of Google Music. GMusicProxy can't use anything that is not supported by gmusicapi. I can spot some references in gmusicapi documentation about free radios (https://unofficial-google-music-api.readthedocs.io/en/latest/reference/mobileclient.html) but it looks they are treated like the others.

NonaSuomy commented 7 years ago

It's definatly supported as said that kodi script above for Google Music uses gmusicapi as well.

http://alternativeto.net/software/tunnelbear/ I believe there is a free account that lets you tunnel to the USA.

https://wiki.archlinux.org/index.php/TunnelBear

NonaSuomy commented 7 years ago

https://github.com/foreverguest/repository.foreverguest/blob/master/plugin.audio.googlemusic.exp/plugin.audio.googlemusic.exp-1.11.1.zip

It's python as well.

NonaSuomy commented 7 years ago

looks like all you have to add is this

https://github.com/simon-weber/gmusicapi/pull/460

https://github.com/simon-weber/gmusicapi/pull/460/commits/b91febbbd8cc7f5c3b7ee1beddc419cd88b4abad

foreverguest commented 7 years ago

Hi, for Kodi addon, I had to add the missing free radio calls in gmusicapi and distribute it within the addon.

NonaSuomy commented 7 years ago

@foreverguest would have been nice to be able to see those changes in your repo but it seems you upload it as a zip instead of source code :cry: any chance you can elaborate, was it basically the listen_now stuff? how does it send back the audio content, what are the strings you send the api and what does the return URL audio format look like etc that you send kodi to play?

foreverguest commented 7 years ago

Ok, I did a fork with the changes needed: https://github.com/simon-weber/gmusicapi/compare/develop...foreverguest:develop

foreverguest commented 7 years ago

Get first track url:

station=gmusicapi.create_station(name,track_id,artist_id,album_id,genre_id,playlist_token,curated_station_id)

sessiontoken = station['sessionToken']

trackid = station['tracks'][0]['storeId']

wentryid = station['tracks'][0]['wentryId']

url = gmusicapi.get_stream_url(trackid, session_token=sessiontoken, wentry_id=wentryid)
NonaSuomy commented 7 years ago

@foreverguest can you show sample data input and sample data output?

Thank you.

mario-tux commented 7 years ago

Thank you to @NonaSuomy for opening the question and thank you to @foreverguest for providing the necessary support to the Free Radios in gmusicapi. I'll support them when such support will be submitted to @simon-weber and accepted by him in official releases of gmusicapi. I don't want to use for GMusicProxy a fork for such library.

simon-weber commented 7 years ago

Oh, neat, I didn't know that was a thing. Yeah, feel free to open up an issue and/or PR on gmusicapi.

NonaSuomy commented 7 years ago

@foreverguest can you submit the pull request for your additions to gmusicapi for the free stations, thank you!

NonaSuomy commented 7 years ago

Future reference: https://github.com/simon-weber/gmusicapi/issues/552

NonaSuomy commented 7 years ago

Hi again, the code is now in the development branch of gmusicapi if you would like to check it out to see if you can get something going https://github.com/simon-weber/gmusicapi/pull/561 Thank you!

NonaSuomy commented 5 years ago

Merged into gmusicapi since version 11 for anyone willing to add support! References gmusicapi issue 552 seems this project was able to utilize it so far if it helps: tizonia-openmax-il