Kodi Community Forum

Full Version: Google Music Addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Hi all.

Just tried 0.8exp15, it works like a charm.
Even stations are working !
Many thanks for all this great work Foreverguest & others, i'm staying tuned Wink

Pierre.
Pierre, how did you get it to work? I've tried everything I can think of, but all I get is the turning wheel.
(2013-12-06, 21:45)foreverguest Wrote: [ -> ]So ios device type is IOS! Go figure.

Please try this version supporting IOS device type: 0.8exp16

foreverguest,
First off, nice work!! I just got this up and running on my raspberry pi with openelec and it works great, took me a few tries to realize windows 8 was creating a secret partition table that was screwing everything up but the addon was pretty much a breeze to get working. I was just curious if there was any api calls that would allow for the music to be downloaded to the device. I think that would be a great addition (at least for my set-up).

Also as a sidenote how would one get into add-on making, I would like to do that. I'm a computer science major but my background is heavily in c++ and java, not much else besides that, but I have alot of resources. If you could point me in the right direction that would be awesome thanks!
(2013-12-10, 20:15)snaveevans Wrote: [ -> ]
(2013-12-06, 21:45)foreverguest Wrote: [ -> ]So ios device type is IOS! Go figure.

Please try this version supporting IOS device type: 0.8exp16

foreverguest,
First off, nice work!! I just got this up and running on my raspberry pi with openelec and it works great, took me a few tries to realize windows 8 was creating a secret partition table that was screwing everything up but the addon was pretty much a breeze to get working. I was just curious if there was any api calls that would allow for the music to be downloaded to the device. I think that would be a great addition (at least for my set-up).

Also as a sidenote how would one get into add-on making, I would like to do that. I'm a computer science major but my background is heavily in c++ and java, not much else besides that, but I have alot of resources. If you could point me in the right direction that would be awesome thanks!

Check out this section: http://wiki.xbmc.org/index.php?title=Add-on_development
(2013-12-10, 00:29)bruce7373 Wrote: [ -> ]Pierre, how did you get it to work? I've tried everything I can think of, but all I get is the turning wheel.

Hi Bruce!

Just installed the 3 files found at the beginning of this thread. Then uninstalled google music plugin (0.8.2) directly from xbmc, and installed google music plugin 0.8exp15 (you can find it in the previous page). As i have activated 2 factor authentication on my google account, i've asked for an application specific password. Then gave my login and this password to google music's plugin. That's all, now everything's working fine!
Perharps it's platform dependent? For information, my XBMC Frodo is running on rPi under Debian Linux (xbian).
You can also find tons of usefull hints in the logfile (/home/xbian/.xbmc/temp on xbian, don't know where on other systems, sry).

Good luck, and keep trying to make it work, it's worth it!

Pierre.
(2013-12-10, 23:37)psanf Wrote: [ -> ]
(2013-12-10, 00:29)bruce7373 Wrote: [ -> ]Pierre, how did you get it to work? I've tried everything I can think of, but all I get is the turning wheel.

Hi Bruce!

Just installed the 3 files found at the beginning of this thread. Then uninstalled google music plugin (0.8.2) directly from xbmc, and installed google music plugin 0.8exp15 (you can find it in the previous page). As i have activated 2 factor authentication on my google account, i've asked for an application specific password. Then gave my login and this password to google music's plugin. That's all, now everything's working fine!
Perharps it's platform dependent? For information, my XBMC Frodo is running on rPi under Debian Linux (xbian).
You can also find tons of usefull hints in the logfile (/home/xbian/.xbmc/temp on xbian, don't know where on other systems, sry).

Good luck, and keep trying to make it work, it's worth it!

Pierre.

Thanks for the tips, Pierre. I'm running XBMC Frodo as well on an Exoon Power Pro box which is Android-based (JB 4.2.2). I took the exact steps you did (initial 3 files, replace the actual plugin with exp15). I don't have double authorization with Google, just my user and basic pw that works on my phone and media pc. I'll take a look at the logfile and see what's up. I finally got Pandora working, but it'd be nice to listen to my own stuff. Wink
snaveevans, the addon here uses the Unofficia-Google-Music-Api by Simon Weber, it supports track download too. If it's interesting to you, could be a good project to start programming in python.

bruce7373, I can confirm the spinning wheel behavior on a smartphone with Android 4.1. I think it's platform specific bug. I was not able to configure xbmc to generate a log so I'm blind here, will keep testing.
(2013-12-11, 04:02)foreverguest Wrote: [ -> ]snaveevans, the addon here uses the Unofficia-Google-Music-Api by Simon Weber, it supports track download too. If it's interesting to you, could be a good project to start programming in python.

bruce7373, I can confirm the spinning wheel behavior on a smartphone with Android 4.1. I think it's platform specific bug. I was not able to configure xbmc to generate a log so I'm blind here, will keep testing.

Appreciate it. Smile
Hi the plugin is working just fine, but as I'm running it on a headless raspberry pi I'm using an android xbmc client to control it. Because it takes so long to find tracks, the remote client often times out, which is frustrating.

Having had a quick dig in the code of the add-on, it looks like the python is filtering through all the tracks to find all the songs in an album - am I right or have I got the wrong end of the stick? If so, then surely as gmusic can hold 20,000 tracks it must be more efficient to use a db to do this?
When you first use the addon it loads all music library metadata in a local db, and all subsequent access to the library is made to this db. As my main use of this addon is on a raspberry-pi, I'm very interested in improving its performance.

Your xbmc config dir is located on the sd card, external storage or local network? Try to place it in the faster storage you have.

By your description the main slowdown is when listing all tracks from a single album. Is this right? How long it is taking?
Everything on SD. Don't know how long it is taking, but long enough to time out. If the filtering was in the SQL instead of the python I imagine it would be much faster. I'm going to have a go at recording this bit myself...
Hello,

disregard my previous message I failed to use the search. Shame on me.
Hey there guys,

at first I want to thank you foreverguest for this addon and please keep up the great work!

I got only one question:

When I try to access any song in google music which I didnt bought, I get an 403 error. Is this normal? Does this Addon only work with purchased Songs?

Thanks in advance!

Greetings from germany Smile

*edit*

ok i searched this thread and it should work but it doesnt and i guess its because of the wrong device id. But how do i tell your addon to use the id of my cell phone?

here is the error:

Code:
16:35:06 T:140209651959552   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'gmusicapi.exceptions.CallFailure'>
                                            Error Contents: GetStreamUrl: 403 Client Error: Forbidden
                                            (requests kwargs: {'headers': {'X-Device-ID': '3144f3b084418073', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'songid': '601077a8-82e9-324d-acd4-13d009324e82', 'pt': 'e', 'slt': '1387384505845', 'sig': 'qFil4Kh3GdoavkS-_XMdwhTBAZw', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
                                            (response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
                                            Traceback (most recent call last):
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/default.py", line 50, in <module>
                                                song.play(get("song_id"),params)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 20, in play
                                                url = self.__getSongStreamUrl(song_id)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 75, in __getSongStreamUrl
                                                return self.api.getSongStreamUrl(song_id)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicApi.py", line 86, in getSongStreamUrl
                                                stream_url = self.gmusicapi.get_stream_url(song_id, device_id)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/mobileclient.py", line 216, in get_stream_url
                                                return self._make_call(mobileclient.GetStreamUrl, song_id, device_id)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/shared.py", line 67, in _make_call
                                                return protocol.perform(self.session, self.validate, *args, **kwargs)
                                              File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/protocol/shared.py", line 226, in perform
                                                raise CallFailure(err_msg, call_name)
                                            CallFailure: GetStreamUrl: 403 Client Error: Forbidden
                                            (requests kwargs: {'headers': {'X-Device-ID': '3144f3b084418073', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'songid': '601077a8-82e9-324d-acd4-13d009324e82', 'pt': 'e', 'slt': '1387384505845', 'sig': 'qFil4Kh3GdoavkS-_XMdwhTBAZw', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
                                            (response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
                                            -->End of Python script error report<--

*editedit*

seems like he successfully fetches my devices but why do i still get a 403 error? here is the log

Code:
16:34:59 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] Trying to fetch the device_id
16:34:59 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] [{u'date': 1386577854013, u'type': u'DESKTOP_APP', u'id': u'00:19:66:F9:F2:A9', u'name': u'desktop'}, {u'name': u'', u'carrier': u'Huawei', u'date': 1386580496125, u'model': u'MediaPad 10 LINK', u'type': u'PHONE', u'id': u'0x3144f3b084418073', u'manufacturer': u'HUAWEI'}, {u'name': u'', u'carrier': u'Generic', u'date': 1386602320793, u'model': u'LG-P990', u'type': u'PHONE', u'id': u'0x3c9cf93af01c9a14', u'manufacturer': u'LGE'}]
16:34:59 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] Found device_id: 3144f3b084418073
16:34:59 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] Loading library
16:34:59 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] Logging in
16:35:00 T:140209651959552  NOTICE: [GoogleMusic-0.8exp16] Login succeeded
Foreverguest,

I'm happy to say that the empty playlist issue is resolved. I can see my all access items in the playlists and radio. Well done! However if I want to play a song it gives me a script error.. Here is my log:

Thank you in advance

9:51:30 T:140457341343488 NOTICE: Thread BackgroundLoader start, auto delete: false
19:51:32 T:140458024830720 NOTICE: Thread XBPyThread start, auto delete: false
19:51:32 T:140458024830720 NOTICE: -->Python Interpreter Initialized<--
19:51:32 T:140458024830720 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '11', '?path=playlists&playlist_type=user']
19:51:32 T:140458024830720 NOTICE: warning: could not import appdirs; will use current directory
19:51:33 T:140458024830720 NOTICE: CommonFunctions-2.5.1
19:51:33 T:140458024830720 NOTICE: [GoogleMusic-0.8exp16] Getting playlists of type: user
19:51:33 T:140457341343488 NOTICE: Thread BackgroundLoader start, auto delete: false
19:51:34 T:140458024830720 NOTICE: Thread XBPyThread start, auto delete: false
19:51:34 T:140458024830720 NOTICE: -->Python Interpreter Initialized<--
19:51:34 T:140458024830720 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '12', '?path=playlist&playlist_id=eca6c521-9ba8-4cd2-88d9-969a2cd5f2c9']
19:51:34 T:140458024830720 NOTICE: warning: could not import appdirs; will use current directory
19:51:35 T:140458024830720 NOTICE: CommonFunctions-2.5.1
19:51:35 T:140458024830720 NOTICE: [GoogleMusic-0.8exp16] Loading playlist: eca6c521-9ba8-4cd2-88d9-969a2cd5f2c9
19:51:35 T:140457341343488 NOTICE: Thread BackgroundLoader start, auto delete: false
19:51:37 T:140457341343488 NOTICE: Thread XBPyThread start, auto delete: false
19:51:37 T:140457341343488 NOTICE: -->Python Interpreter Initialized<--
19:51:37 T:140457341343488 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '13', '?action=play_song&song_id=Tfbnaiawv55adqfeq32zrbownfq']
19:51:37 T:140457341343488 NOTICE: warning: could not import appdirs; will use current directory
19:51:37 T:140457341343488 NOTICE: [GoogleMusic-0.8exp16] Prefetch disabled or URL invalid or expired :
19:51:37 T:140457341343488 NOTICE: [GoogleMusic-0.8exp16] Loading auth from cache
19:51:37 T:140457341343488 NOTICE: [GoogleMusic-0.8exp16] getSongStreamUrl device: 38e6cfd1de6b2177
19:51:38 T:140457341343488 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'gmusicapi.exceptions.CallFailure'>
Error Contents: GetStreamUrl: 403 Client Error: Forbidden
(requests kwargs: {'headers': {'X-Device-ID': '38e6cfd1de6b2177', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'mjck': 'Tfbnaiawv55adqfeq32zrbownfq', 'pt': 'e', 'slt': '1387392698009', 'sig': '14ryGevkD_kF--35kr-zIDpP_6s', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
Traceback (most recent call last):
File "/storage/.xbmc/addons/plugin.audio.googlemusic/default.py", line 50, in <module>
song.play(get("song_id"),params)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 20, in play
url = self.__getSongStreamUrl(song_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 75, in __getSongStreamUrl
return self.api.getSongStreamUrl(song_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicApi.py", line 86, in getSongStreamUrl
stream_url = self.gmusicapi.get_stream_url(song_id, device_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/mobileclient.py", line 216, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/shared.py", line 67, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/protocol/shared.py", line 226, in perform
raise CallFailure(err_msg, call_name)
CallFailure: GetStreamUrl: 403 Client Error: Forbidden
(requests kwargs: {'headers': {'X-Device-ID': '38e6cfd1de6b2177', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'mjck': 'Tfbnaiawv55adqfeq32zrbownfq', 'pt': 'e', 'slt': '1387392698009', 'sig': '14ryGevkD_kF--35kr-zIDpP_6s', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
-->End of Python script error report<--
19:51:38 T:140459402712896 ERROR: Playlist Player: skipping unplayable item: 2, path [plugin://plugin.audio.googlemusic/?action=play_song&song_id=Tfbnaiawv55adqfeq32zrbownfq]
19:52:30 T:140459402712896 NOTICE: Samba is idle. Closing the remaining connections
19:53:18 T:140458038650624 NOTICE: Thread XBPyThread start, auto delete: false
19:53:18 T:140459402712896 ERROR: Control 50 in window 10502 has been asked to focus, but it can't
19:53:18 T:140458038650624 NOTICE: -->Python Interpreter Initialized<--
19:53:18 T:140458038650624 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '14', '?path=playlist&playlist_id=eca6c521-9ba8-4cd2-88d9-969a2cd5f2c9']
19:53:18 T:140458038650624 NOTICE: warning: could not import appdirs; will use current directory
19:53:19 T:140458038650624 NOTICE: CommonFunctions-2.5.1
19:53:19 T:140458038650624 NOTICE: [GoogleMusic-0.8exp16] Loading playlist: eca6c521-9ba8-4cd2-88d9-969a2cd5f2c9
19:53:19 T:140458881881856 NOTICE: Thread BackgroundLoader start, auto delete: false
19:53:19 T:140458038650624 NOTICE: Thread Jobworker start, auto delete: true
19:53:21 T:140458881881856 NOTICE: Thread XBPyThread start, auto delete: false
19:53:21 T:140457341343488 NOTICE: Thread Jobworker start, auto delete: true
19:53:21 T:140458881881856 NOTICE: -->Python Interpreter Initialized<--
19:53:21 T:140458881881856 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '15', '?action=play_song&song_id=Tafofhzssq6k5w2ur4kiejqorpy']
19:53:21 T:140458881881856 NOTICE: warning: could not import appdirs; will use current directory
19:53:22 T:140458881881856 NOTICE: [GoogleMusic-0.8exp16] Prefetch disabled or URL invalid or expired :
19:53:22 T:140458881881856 NOTICE: [GoogleMusic-0.8exp16] Loading auth from cache
19:53:22 T:140458881881856 NOTICE: [GoogleMusic-0.8exp16] getSongStreamUrl device: 38e6cfd1de6b2177
19:53:22 T:140458881881856 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'gmusicapi.exceptions.CallFailure'>
Error Contents: GetStreamUrl: 403 Client Error: Forbidden
(requests kwargs: {'headers': {'X-Device-ID': '38e6cfd1de6b2177', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'mjck': 'Tafofhzssq6k5w2ur4kiejqorpy', 'pt': 'e', 'slt': '1387392802135', 'sig': '-Q3gKfH7lzTXWxUf9GV5-G31Ihw', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
Traceback (most recent call last):
File "/storage/.xbmc/addons/plugin.audio.googlemusic/default.py", line 50, in <module>
song.play(get("song_id"),params)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 20, in play
url = self.__getSongStreamUrl(song_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicPlaySong.py", line 75, in __getSongStreamUrl
return self.api.getSongStreamUrl(song_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/GoogleMusicApi.py", line 86, in getSongStreamUrl
stream_url = self.gmusicapi.get_stream_url(song_id, device_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/mobileclient.py", line 216, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/clients/shared.py", line 67, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/storage/.xbmc/addons/plugin.audio.googlemusic/gmusicapi/protocol/shared.py", line 226, in perform
raise CallFailure(err_msg, call_name)
CallFailure: GetStreamUrl: 403 Client Error: Forbidden
(requests kwargs: {'headers': {'X-Device-ID': '38e6cfd1de6b2177', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'mjck': 'Tafofhzssq6k5w2ur4kiejqorpy', 'pt': 'e', 'slt': '1387392802135', 'sig': '-Q3gKfH7lzTXWxUf9GV5-G31Ihw', 'net': 'wifi'}, 'url': 'https://android.clients.google.com/music/mplay', 'verify': False, 'allow_redirects': False, 'method': 'GET'})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')
-->End of Python script error report<--
19:53:22 T:140459402712896 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.audio.googlemusic/?action=play_song&song_id=Tafofhzssq6k5w2ur4kiejqorpy]
19:53:36 T:140459402712896 WARNING: GetLabel - Unknown nodetype requested 0
19:53:36 T:140458881881856 WARNING: Previous line repeats 1 times.
19:53:36 T:140458881881856 NOTICE: Thread BackgroundLoader start, auto delete: false
19:53:44 T:140458881881856 NOTICE: Thread XBPyThread start, auto delete: false
19:53:44 T:140458881881856 NOTICE: -->Python Interpreter Initialized<--
19:53:44 T:140458881881856 NOTICE: GoogleMusic-0.8exp16 ARGV: ['plugin://plugin.audio.googlemusic/', '-1', '?action=clear_cookie']
19:53:45 T:140458881881856 NOTICE: warning: could not import appdirs; will use current directory
Errors "403 Client Error: Forbidden" are usually related to simultaneously access from different devices.

User Jimbo99 was able to solve these errors by cleaning cache, cookies and restarting xbmc, please check post #263.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35