Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NonaSuomy opened this issue May 12, 2017 · 19 comments
Open

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

NonaSuomy opened this issue May 12, 2017 · 19 comments

Comments

@NonaSuomy
Copy link

  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.

@NonaSuomy NonaSuomy changed the title Can't stream free radio stations Can't stream free radio stations with a non-subscriber account May 12, 2017
@mario-tux
Copy link
Collaborator

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

@NonaSuomy
Copy link
Author

NonaSuomy commented May 15, 2017

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
Copy link
Author

NonaSuomy commented May 15, 2017

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
Copy link
Author

@mario-tux
Copy link
Collaborator

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
Copy link
Author

NonaSuomy commented May 15, 2017

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
Copy link
Author

looks like all you have to add is this

simon-weber/gmusicapi#460

simon-weber/gmusicapi@b91febb

@foreverguest
Copy link

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

@NonaSuomy
Copy link
Author

@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 😢 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
Copy link

Ok, I did a fork with the changes needed:
simon-weber/gmusicapi@develop...foreverguest:develop

@foreverguest
Copy link

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
Copy link
Author

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

Thank you.

@mario-tux
Copy link
Collaborator

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
Copy link

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

@NonaSuomy
Copy link
Author

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

@NonaSuomy
Copy link
Author

Future reference: simon-weber/gmusicapi#552

@NonaSuomy
Copy link
Author

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 simon-weber/gmusicapi#561 Thank you!

@NonaSuomy
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants