Kodi Community Forum
Release Experimental Google Music Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Music Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=148)
+---- Thread: Release Experimental Google Music Addon (/showthread.php?tid=200640)



RE: Experimental Google Music Addon - Abbaskip - 2018-10-20

(2018-10-16, 23:20)foreverguest Wrote: For those with problems logging in, try using this option https://accounts.google.com/b/0/DisplayUnlockCaptcha.
 Still not working for me Sad

I've followed that link and enabled account access. I'm using an App password as I have 2 factor authentication, but not working.

Should I turn off 2 factor and just enable account access?


RE: Experimental Google Music Addon - Abbaskip - 2018-10-20

It seems it suddenly started working again. I kept trying to login, clear cache, login, enable account access, clear cache etc etc etc haha


RE: Experimental Google Music Addon - Abbaskip - 2018-10-31

I'm getting an error nearly whenever I search now. But then some searches work.

Searched for Damien Rice below (I knew this one didn't work as my wife tried it and got an error Tongue )

This is what I'm getting:
Code:
21:03:53.386 T:138488  NOTICE: [GoogleMusicEXP-1.11.1] API getsearch: Damien rice
21:03:53.390 T:85796   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Input.OnInputFinished  - data: null
21:03:53.601 T:139580   DEBUG: plugin.program.autocompletion: download http://clients1.google.com/complete/search?hl=en&q=Damien+rice&json=t&client=serp&ds=yt. time: 0.350000
21:03:53.618 T:139580   DEBUG: plugin.program.autocompletion: saved textfile C:\Users\Abba\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.autocompletion\Google\ea72b96f70d893d753256e61c4c7139d.txt. Time: 0.012000
21:03:53.903 T:138488  NOTICE: [GoogleMusicEXP-1.11.1] Loading auth from cache
21:03:53.946 T:139580   DEBUG: finished
21:03:53.946 T:139580    INFO: CPythonInvoker(923, C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.program.autocompletion\plugin.py): script successfully run
21:03:53.954 T:139580   DEBUG: CPythonInvoker::onExecutionDone(923, C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.program.autocompletion\plugin.py)
21:03:54.062 T:139580    INFO: Python interpreter stopped
21:03:54.062 T:139580   DEBUG: Thread LanguageInvoker 139580 terminating
21:03:54.252 T:136736   DEBUG: CWebServer[8080]: request received for /jsonrpc
21:03:55.497 T:69752   DEBUG: Previous line repeats 1 times.
21:03:55.497 T:69752    INFO: JSONRPC Server: Disconnection detected
21:03:55.601 T:138488  NOTICE: [GoogleMusicEXP-1.11.1] Loaded 10 tracks (1 art miss)
21:03:55.601 T:138488  NOTICE: [GoogleMusicEXP-1.11.1] Loaded 10 albums (0 art miss)
21:03:55.601 T:138488  NOTICE: [GoogleMusicEXP-1.11.1] API search results: tracks 14 albums 13 artists 2 stations 8 videos 20
21:03:55.781 T:138488   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\u2013' in position 12: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\default.py", line 40, in <module>
                                                GoogleMusicNavigation.GoogleMusicNavigation().listMenu(params)
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 122, in listMenu
                                                listItems = self.getSearch(keyboard.getText())
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 553, in getSearch
                                                listItems.append(self.createFolder(video['title'],{'action':'play_yt','display_name':video['title']}))
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 428, in createFolder
                                                return "?".join([utils.addon_url, urlencode(params)]), li, "true"
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib.py", line 1343, in urlencode
                                                v = quote_plus(str(v))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 12: ordinal not in range(128)
                                            -->End of Python script error report<--
21:03:55.788 T:138488   DEBUG: CPythonInvoker::onExecutionDone(920, C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\default.py)
21:03:55.859 T:84540   DEBUG: ------ Window Init (DialogNotification.xml) ------
21:03:55.936 T:138488    INFO: Python interpreter stopped
21:03:55.936 T:138488   DEBUG: Thread LanguageInvoker 138488 terminating
21:03:55.956 T:138712   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.audio.googlemusic.exp/?path=search_new
21:03:55.956 T:138712   DEBUG: Thread waiting 138712 terminating
21:03:55.965 T:84540   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
21:03:55.965 T:84540   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.googlemusic.exp/?path=search_new) failed
21:03:55.965 T:84540   DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.audio.googlemusic.exp/?path=search)
21:03:55.965 T:84540   DEBUG:   ParentPath = [plugin://plugin.audio.googlemusic.exp/]
21:03:55.965 T:84540   DEBUG: Loading items: 1, directory: plugin://plugin.audio.googlemusic.exp/?path=search sort method: 0, ascending: false
21:03:55.980 T:140820   DEBUG: CAddonDatabase::SetLastUsed[plugin.audio.googlemusic.exp] took 15 ms

Another example is searching for Happy Days:
Code:
21:08:47.037 T:139760  NOTICE: [GoogleMusicEXP-1.11.1] API getsearch: happy days
21:08:47.527 T:139760  NOTICE: [GoogleMusicEXP-1.11.1] Loading auth from cache
21:08:49.211 T:139760  NOTICE: [GoogleMusicEXP-1.11.1] Loaded 10 tracks (1 art miss)
21:08:49.212 T:139760  NOTICE: [GoogleMusicEXP-1.11.1] Loaded 10 albums (0 art miss)
21:08:49.212 T:139760  NOTICE: [GoogleMusicEXP-1.11.1] API search results: tracks 20 albums 11 artists 11 stations 27 videos 20
21:08:49.314 T:139760   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\u3010' in position 0: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\default.py", line 40, in <module>
                                                GoogleMusicNavigation.GoogleMusicNavigation().listMenu(params)
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 122, in listMenu
                                                listItems = self.getSearch(keyboard.getText())
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 553, in getSearch
                                                listItems.append(self.createFolder(video['title'],{'action':'play_yt','display_name':video['title']}))
                                              File "C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicNavigation.py", line 428, in createFolder
                                                return "?".join([utils.addon_url, urlencode(params)]), li, "true"
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib.py", line 1343, in urlencode
                                                v = quote_plus(str(v))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\u3010' in position 0: ordinal not in range(128)
                                            -->End of Python script error report<--
21:08:49.322 T:139760   DEBUG: CPythonInvoker::onExecutionDone(953, C:\Users\Abba\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\default.py)
21:08:49.388 T:84540   DEBUG: ------ Window Init (DialogNotification.xml) ------

Seems to be a unicode/ascii error with one of the chars being returned?

I've never done any Python - but programmed in another life time, and I think it's along the lines of what's mentioned here:
https://docs.python.org/2.7/howto/unicode.html#the-unicode-type


RE: Experimental Google Music Addon - Abbaskip - 2018-10-31

Actually - so I got mine working. The issue is in a Kodi file - urllib.py

Lilne 1343 has:
Code:
v = quote_plus(str(v))

I changed this to:
Code:
v = quote_plus(v.encode('ascii', 'ignore'))

I'm assuming the other mentions of str should be replaced in this same way. As I'm not really up with github and suggesting changes etc, how would I go about suggesting this is changed in the next Kodi version?


RE: Experimental Google Music Addon - Abbaskip - 2018-10-31

I also found that when searching previous searches, your addon is using %20 etc instead of a space. This means it will only return YouTube results for cached search with a space in it.

I've fixed this by adding from line 116 in GoogleMusicApi.py:
Code:
        import urllib    
        query = urllib.unquote(query).decode('utf8')    

Obviously ensure indentation is correct etc.


RE: Experimental Google Music Addon - Abbaskip - 2018-11-01

(2018-10-31, 12:27)Abbaskip Wrote: Actually - so I got mine working. The issue is in a Kodi file - urllib.py

Lilne 1343 has:
Code:
v = quote_plus(str(v))

I changed this to:
Code:
v = quote_plus(v.encode('ascii', 'ignore'))

I'm assuming the other mentions of str should be replaced in this same way. As I'm not really up with github and suggesting changes etc, how would I go about suggesting this is changed in the next Kodi version?
Obviously not ideal doing this in the Kodi Python library, so I'm going to investigate why it's causing the error in the add-on. Thinking the add-on can possibly just decode instead of changing how Kodi handles it.

Not home tonight but will play around over the weekend. See if I can make it 2/2 big fix pull requests for you @foreverguest


RE: Experimental Google Music Addon - Abbaskip - 2018-11-05

(2018-11-01, 04:06)Abbaskip Wrote:
(2018-10-31, 12:27)Abbaskip Wrote: Actually - so I got mine working. The issue is in a Kodi file - urllib.py

Lilne 1343 has:
Code:
v = quote_plus(str(v))

I changed this to:
Code:
v = quote_plus(v.encode('ascii', 'ignore'))

I'm assuming the other mentions of str should be replaced in this same way. As I'm not really up with github and suggesting changes etc, how would I go about suggesting this is changed in the next Kodi version?
Obviously not ideal doing this in the Kodi Python library, so I'm going to investigate why it's causing the error in the add-on. Thinking the add-on can possibly just decode instead of changing how Kodi handles it.

Not home tonight but will play around over the weekend. See if I can make it 2/2 big fix pull requests for you @foreverguest

So the fix to this issue has now been submitted to the github too.

When calling urlencode doseq needed to be set to true (as what we were passing was a dict).

This means urllib.py can be left alone as it should be, and instead line 428 of GoogleMusicNavigation.py

Should be changed from:
Code:
return "?".join([utils.addon_url, urlencode(params)]), li, "true"

to:
Code:
return "?".join([utils.addon_url, urlencode(params, doseq=True)]), li, "true"



RE: Experimental Google Music Addon - vojta1 - 2018-11-21

Quote:For those with problems logging in, try using this option https://accounts.google.com/b/0/DisplayUnlockCaptcha.

It seems I have to approve this every week. Do you know if there is possibility to approve access permanently?


RE: Experimental Google Music Addon - Abbaskip - 2018-11-22

(2018-11-21, 11:42)vojta1 Wrote:
Quote:For those with problems logging in, try using this option https://accounts.google.com/b/0/DisplayUnlockCaptcha.

It seems I have to approve this every week. Do you know if there is possibility to approve access permanently? 
Ha - came here to post exactly this. It's pretty frustrating - esp as I need 2FF enabled, so I need to login with that, approve once each week.


RE: Experimental Google Music Addon - Abbaskip - 2018-12-31

(2018-11-21, 11:42)vojta1 Wrote:
Quote:For those with problems logging in, try using this option https://accounts.google.com/b/0/DisplayUnlockCaptcha.

It seems I have to approve this every week. Do you know if there is possibility to approve access permanently?

Mine seems to be working again now? Haven't head to give access again for a few weeks?

Maybe it's because I added a widget to my home screen which refreshes the login daily?


RE: Experimental Google Music Addon - jmh2002 - 2018-12-31

I think google might have changed something to fix this. I haven't made any changes since it was 'broken', I don't have a widget, but I just tried to access my music and things seemed to be working normally again (I didn't check every feature but I can access my library and play music) Smile


RE: Experimental Google Music Addon - Abbaskip - 2019-01-07

(2018-12-31, 17:08)jmh2002 Wrote: I think google might have changed something to fix this. I haven't made any changes since it was 'broken', I don't have a widget, but I just tried to access my music and things seemed to be working normally again (I didn't check every feature but I can access my library and play music) Smile

Interestingly I got an email from Google the other day around an issue Google had with applications that had been authorised to use accounts. Assuming it was sent to everybody, but I wonder if this was what was causing the issues.


RE: Experimental Google Music Addon - randalstroup - 2019-01-27

1) My "I'm Feeling Lucky" playlist loads but won't play...log is here>https://paste.kodi.tv/qaqehiqazo.kodi

2) Trying to play a "radio station" playlist results in Kodi crashing.

3) Why the #$!#$ doesn't anything seem to just "work" in Kodi!


RE: Experimental Google Music Addon - Abbaskip - 2019-01-28

(2019-01-27, 19:36)randalstroup Wrote: 1) My "I'm Feeling Lucky" playlist loads but won't play...log is here>https://paste.kodi.tv/qaqehiqazo.kodi

2) Trying to play a "radio station" playlist results in Kodi crashing.

3) Why the #$!#$ doesn't anything seem to just "work" in Kodi!

Radio stations are crashing Kodi for me too now. Wondering if Google have changed something which leads to an invalid URL being called or similar.

I suggest finding a song and starting radio from that as a short-term fix, and then posting your error on the github


RE: Experimental Google Music Addon - etchings13 - 2019-02-05

I don't know if this is helpful but this plug-in still works for me in Kodi 17.6. That includes radio stations but not "I'm Feeling Lucky". After recently upgrading (I tried a clean install as well) to 18.0, I lost everything except my uploaded songs, so I ended up downgrading back to 17.6 and it works as it did before. I just wanted to mention this in case people were thinking it was Google causing the radio issues when the problem might actually be Kodi 18.0.