Closed aqtrans closed 9 years ago
Same error on Ubuntu 14.04, Python 2.7.6. Login is definitely successful. Could this just be an encoding issue, say if the keys aren't stored as unicode? If that's the case, just a simple str() would solve the issue. Tried it, didn't work.
As a quick fix I just wrote this in:
for track in plist["tracks"]:
try:
song = song_map[track["trackId"]]
except:
pass
else:
self.playlists[plist_name].append(song)
Can you tell which playlist it is? Does it contain All Access tracks? I'm not really sure what would be causing this issue.
It's just the first one of my playlists; and yes, it has All Access tracks. Maybe the id of an All Access song doesn't work in the same way with the API? I haven't done too much reading on the All Access issue to be honest, I'm not even sure if the gmusicapi allows you to stream an All Access track... api.search_all_access() does return tracks with an 'nid' key but I can't see an 'id' key.
Can confirm this issue. I'm also seeing it on Ubuntu 14.04 with Python 2.7.6. @bedekelly 's workaround is successful. However, the only songs that pass that check appear to be songs that have been purchased and are available for download.
This used to work for all access tracks (I added all access support earlier this year). I'll be looking into this further to try and find a workaround.
Part of the issue here is this is limited to the songs returned by get_all_songs(). Don't have any more time right now to dig in, but I suspect this is only returning purchased songs.
I'm not convinced that is the issue, on the latest version of gmusicapi I still get music I have uploaded (I don't use All Access and only have about 2 purchased albums).
Right...uploaded music is also available for download. If you upload a song or purchase a song, you are able to download that song. If you can download a song, it shows up in a playlist with the workaround mentioned above.
With All Access, you are able to add songs that you have not purchased or uploaded to a playlist. However, if you open the options for that song on Google Play Music, you do not have the option to download it. Those songs are not showing in playlists.
I think the underlying issue lies with gmusicapi itself; it doesn't treat All Access songs as belonging to your library. Perhaps Google is more restrictive about generating stream URLs for All Access songs? Could be beneficial to ask Simon Weber for clarification.
Sorry, was thinking of non-library songs. My own player hasn't been experiencing any problems playing All Access songs (that have been added to the library), so I'm not sure what's going on here. For me, get_all_songs
does return every song currently in my library, not just the ones I've uploaded.
Yep, I wrote a quick script that calls get_all_user_playlist_contents() and then get_stream_url() for each track in a playlist. I am able to get stream URLs for every track, including All Access tracks.
The issue is with the implementation in playmusiccl. It is storing songs via get_all_songs(), and only allowing those songs to be played from your playlists. It appears get_all_songs() is only returning uploaded or purchased songs.
I've created a simple script that takes 1 argument (name of a GPM playlist) and plays all songs in the playlist, including All Access tracks. It's a quick proof of concept that the API supports All Access. It's available here (http://pastebin.com/V7E8najs) if you want to check it out. Note that you'll have to enter your credentials at the top, and change the command used to play the stream if you don't have VLC installed or if it's installed in a different location.
I think there was a reason why I didn't originally do something like that, are the song dicts that get_all_user_playlist_contents()
returns the same as get_all_songs()
?
Usually I would take more time to look at this myself but since I don't use All Access I'm kind of stuck here.
They are different. The tracks returned by get_all_user_playlist_contents() seem to have a subset of the song information returned by get_all_songs(). Tracks don't include things such as artist/album/rating/etc, so it would likely prevent (or at least require some workaround) to Thumbs Up/Down an All Access song.
That sounds familiar, missing out that information would be inhibiting to other features (rating, Last.fm, etc.).
So, I'm not sure what your decision would be here. If you do not intend to support All Access due to the items mentioned, I think @bedekelly 's workaround should probably be implemented to prevent other people from experiencing the issue. Just my $.02.
I would like to support it, but not at the cost of other features. The fix you suggest would not be suitable since not all the track data would be available.
I'm sure there must be some way to get this data for All Access tracks.
Is this issue ever going to be fixed? I just installed playmusiccl and got this error. I am using a Play Music All Access account on a Raspberry Pi running the latest version of Raspbian.
As per the conversation so far, supporting all access with the current API would break existing features (unless of course the API has since changed).
I have neither an all access account or the time to look at this right now.
How about making the README warn of the problem? Something like:
A command line client for Google Play Music. Note that it does not support Google Play All Access.
I give in, I'll try to fix all access if someone is available to test it for me.
I volunteer. I'm running Debian and installed PlayMusicCL using pip. I'm a sysadmin and developer, but not a Python developer.
Cool. I admit I may not get round to this for a few weeks as I'm fairly busy with full time and evening work at the moment.
This should make things easier: http://www.androidcentral.com/google-play-music-launches-free-ad-supported-version-us
I'm in the UK.
Besides I could just use the 30 day trial, the issue keeping me from finishing this at the moment is time.
PR #26 seems to have fixed this, my playlists with a combination of all access and uploaded tracks now work. If those originally having the problem are happy I will close this.
I cannot seem to get this working on ArchLinux running with Python 2.7.8, it spits out the following:
I installed both PlayMusicCL and Unofficial-Google-Music-API from git. I did have to make some slight modifications to the PlayMusicCL scripts in order to allow them to run properly in the python3/python2 ArchLinux environment:
The "Updating local library from Google Play Music..." bit seems to take a while, and stracing the process does show some successful communication, so I think it's logging in at least.