Kodi Community Forum

Full Version: Google Drive for KODI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Solution was given since the first response to Publish3r:
You must navigate with the addon entering from the "Music add-ons" option if you want audio files displayed.

Your log says you are navigating with the Video option.
(2018-11-03, 03:15)cguZZMan Wrote: [ -> ]Solution was given since the first response to Publish3r:
You must navigate with the addon entering from the "Music add-ons" option if you want audio files displayed.

Your log says you are navigating with the Video option.
 Yes i read the Post before, thats why i dont understand why no files shows up. i entered correctly through "Music addons" option. Have tried it now again and still shows no entry in different music folders.
m3u are displayed, mp3, flac, wma not. and i am sure i use the correct option. If you want, you can look through Teamviewer if you dont believe...


just read the log and even the log says:
02:02:12.801 T:11444   DEBUG: CGUIMediaWindow::GetDirectory (addons://user/xbmc.addon.audio)
and after this i opened the google drive plugin.
Yup, but if you read a little more down there:

02:02:16.484 T:11444 DEBUG: ------ Window Deinit (DialogAddonInfo.xml) ------
02:02:16.666 T:11444 DEBUG: ------ Window Deinit (AddonBrowser.xml) ------
02:02:16.703 T:11444 DEBUG: ------ Window Init (MyVideoNav.xml) ------
02:02:16.703 T:11444 INFO: Loading skin file: MyVideoNav.xml, load type: KEEP_IN_MEMORY
02:02:16.758 T:11444 DEBUG: [Warning] CGUITextureManager::GetTexturePath: could not find texture 'noop'
02:02:16.765 T:11444 DEBUG: Previous line repeats 10 times.
02:02:16.765 T:11444 DEBUG: Keyboard: scancode: 0x1c, sym: 0x000d, unicode: 0x0000, modifier: 0x0
02:02:16.776 T:11444 DEBUG: Previous line repeats 1 times.
02:02:16.776 T:11444 DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.googledrive/)
02:02:16.776 T:11444 DEBUG: ParentPath = [plugin://plugin.googledrive/]
02:02:16.780 T:4732 DEBUG: CAddonDatabase::SetLastUsed[plugin.googledrive] took 4 ms
02:02:16.780 T:13612 DEBUG: XFILE::CPluginDirectory::StartScript - calling plugin Google Drive('plugin://plugin.googledrive/','1','')
You can see 02:02:16.703 T:11444 DEBUG: ------ Window Init (MyVideoNav.xml) ------ which means that after all you are navigating with the video screen before the addon is called.
So this is because you are using a modified version of Kodi, which is not supported at all, or you are using an skin that doesn't execute the addons correctly.

A correct execution would be something like this:
22:04:05.216 T:489687037008 DEBUG: ------ Window Deinit (Home.xml) ------
22:04:05.222 T:489687037008 DEBUG: ------ Window Init (MyMusicNav.xml) ------
22:04:05.240 T:489687037008 ERROR: Control 55 in window 10502 has been asked to focus, but it can't
22:04:05.260 T:489687037008 DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.onedrive/?content_type=audio)
You can see the MyMusicNav.xml window being called and then the addon being executed with the correct ?content_type=audio parameter.

So you can try with Estuary to see if the problem is your custom skin.
Or if the problem is because a modified Kodi, then you'll need to install a clean version of kodi and test it again.
Please keep posting you debug log file all the time to report an issue and also state if your kodi is modified or you have a custom skin.
(2018-11-03, 04:48)cguZZMan Wrote: [ -> ]So you can try with Estuary to see if the problem is your custom skin.

You're right about the Skin. Used Eminence 2.0 Skin from Kodi Repo.
Tried now Estuary (Ugly Skin xD) and it worked how it should.

Thanks cguZZMan Smile
(2018-10-30, 18:04)cguZZMan Wrote: [ -> ]If you are using the google drive addon to serve files for another addon, you could import the cloud drive common module to your addon and then use a utility class to get the download URL.


     <import addon="script.module.clouddrive.common" />

and then get the url with something like this

from clouddrive.common.service.download import DownloadServiceUtil
url = DownloadServiceUtil.build_download_url(driveid, item_driveid, item_id, filename,'plugin.googledrive')
you can send anything in the filename parameter, not necessarily the real file name.

This will generate an url pointing to the download service of the google drive addon which in turn will redirect it to the real download url from google.
I don't know why, maybe a little error in my code, but it's not working for me.
I tried with http://localhost:8587/source/Google Drive/... and that's working fine. I think it's for my little privat addon enough. Thank you very much. Great work.
When doing my initial sync I am occasionally getting a 500 from google (server temp unavalable) on a large library going to STRM filees

This is stopping the sync.

This does seam to be a temp issue with google and the next API call will work great.

Is there something I can do to avoid this?
Does it make sense to code a retry in this situation?

Any help would be appreciated.

Debug Log

13:26:34.192 T:18446744072808098080 ERROR: [plugin.googledrive][MainThread--901453536]: [plugin.googledrive][1.2.12]/[1.2.8] The server is temporary unavailable for this operation. None Please try again later. Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/ui/addon.py", line 764, in route method(**arguments) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/ui/addon.py", line 388, in _run_export self.__export_folder(driveid, item, export_folder, export, export_items_info) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/ui/addon.py", line 435, in __export_folder self.__export_folder(driveid, item, folder_path, export, items_info) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/ui/addon.py", line 435, in __export_folder self.__export_folder(driveid, item, folder_path, export, items_info) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/ui/addon.py", line 418, in __export_folder items = self.get_provider().get_folder_items(Utils.default(Utils.get_safe_value(folder, 'drive_id'), driveid), folder['id']) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.googledrive/resources/lib/provider/googledrive.py", line 148, in get_folder_items files = provider_method(url, parameters = parameters) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/remote/oauth2.py", line 102, in get return self.request('get', path, **kwargs) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/remote/oauth2.py", line 99, in request return Request(url, data, headers, **request_params).request_json() File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/remote/request.py", line 169, in request_json return json.loads(Utils.default(self.request(), self._DEFAULT_RESPONSE)) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/remote/request.py", line 148, in request raise rex RequestException: HTTP Error 500: Internal Server Error Root cause: Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.clouddrive.common/clouddrive/common/remote/request.py", line 117, in request response = urllib2.urlopen(req) File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 154, in urlopen File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 435, in open File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 548, in http_response File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 473, in error File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 407, in _call_chain File "/home/yxt/kodi17.6/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/urllib2.py", line 556, in http_error_default HTTPError: HTTP Error 500: Internal Server Error Request URL: https://www.googleapis.com/drive/v3/files?q=%271KZJbnPDJ03Z3yAWfAT4YsSlro40ioITO%27+in+parents+and+not+trashed&fields=files%28id%2Cname%2CmodifiedTime%2Csize%2CmimeType%2Cdescription%2ChasThumbnail%2CthumbnailLink%2Cowners%28permissionId%29%2Cparents%2Ctrashed%2CimageMediaMetadata%28width%29%2CvideoMediaMetadata%29%2Ckind%2CnextPageToken&spaces=drive&prettyPrint=false Request data: None Request headers: {'authorization': '*removed*'} Response: Response <Exception>: {"error":{"errors":[{"domain":"global","reason":"internalError","message":"Internal Error"}],"code":500,"message":"Internal Error"}} show_error_dialog: True
@cguZZMan I believe I found a possible bug.  I was able to replicate it as well.  As an example, lets say everything is set up using the strm export method and the addon export function is set to watch for changes and update library as well.  Now lets say I noticed a misspelled movie (strm is created but kodi cant find it on themovie.db), but kodi is left running so the gdrive addon is still checking for changes.  I get onto google drive and remove the file from the folder, now checking back on kodi using the file explorer, the movie is gone along with its folder (I have each movie separated in its own folder).  Now changing the name and re-adding it back into the google drive folder on a browser, I went back to kodi to find that nothing was getting updated.  So going back into the file manager on kodi, it shows the folder created of the newly named file but going inside of that, there is no strm file created. 

I then reset everything, and tested this with a file that worked (was named correctly and was already in my library).
1. went to file explorer in kodi to the directory I planned to move
2. on google drive in browser, I moved movie out of the scope of the export function (movie worked and showed up in kodi)
3. monitored kodi and saw the file and folder were removed and an update library was invoked
4. moved that same file on google drive back into the same spot
5. monitored kodi and saw that the folder was recreated, but no strm file was created nor did the update library get invoked

Here is my log file: http://paste.kodi.tv/zijicacoqe

Edit: Just realized I forgot to enable debug mode, I'll do that later today and get a new log file up after I test again.

Edit 2:  Here is that log file, I redid what I stated above and then some to see what else I could have it do
It looks to misbehave when a file it has seen is then gone

Thanks Again for the amazing addon!  I'll keep looking around to see if I can possibly find the issue.

FYI, the file I used to test this was named Akira

Edit 3: Have not found the problem but found a work around.  On the export, disable "update library" and then install "watchdog" to update and remove.  Seems to work very well actually.

I travel quite a bit, so I have set up a linux vm (Synology) to automatically update stream files every few hours. However, every day it seems to disconnect from the google drive service and requires re-authentication. I'm not sure why this continually happens. I have tried both KODI 17 and 18 and the problem still persists. Can anyone please help?

Thank you in advance.
Dear all,
I've installed Kodi just few days ago on my fire tv stick.
I need to see my "Google Photos" library on tv and I've understood that there is a way to do that by Kodi.
I found an addon for Google Drive and I've installed it, but I'm not expert yet with Kodi and I'm not sure that is the correct addon; infact I can browse in Kodi all my folders of Google Drive but I don't see any access to the library of Google Photo.
Please tell me what is the path to install the correct addon to see Google Photos.
I appreciate, thanks
(2018-10-23, 21:05)cguZZMan Wrote: [ -> ]@wayjin you should be able to navigate through your drive starting from http://localhost:8587/source/
if you have a folder "Movies" in your root, the complete URL would be something like http://localhost:8587/source/Google Drive/<Your Name>/Movies
But you don't have to build the URL yourself, just use the option in Videos > Files > Add videos.. > Browse, and then add source network location and then navigate to your folder.
 Hi - this is the first time I am using the plugin, so I have a question. I am able to access the "Shared with me" folders when I navigate to it using the plug-in interface itself. When I try to add it as a video source the only folders I see are the ones under my Google Drive. So my question is: how can I add the "Shared with Me" folders from my Google Drive account as Movie Source? Thanks.
@stewood thanks for the report. I opened an issue here: https://github.com/cguZZman/plugin.googl.../issues/41. I'll update the resolution there in the future in case you want to follow it up.

@raycekar I'll take a look. Do you mind creating the issue in github?

@ace1024 I need your debug log file to be able to help you.

@egi78 Thanks for posting the issue in github, it was already answered there. I saw your other issue with the suggestions. I'll take a look on it soon when once I have some time.

@gilsonsjc The "Shared with me" folder is not implemented yet in the source mode. It's already in the list of future improvements. https://github.com/cguZZman/plugin.googl.../issues/30
Hi @cguZZMan, Can you research a search file function?
It's in the context menu.
I finally was able to activate my account. I almost gave up on trying. Not sure why it kept saying code invalid . Ill try on my other device today . I have about 76 Team drives and I am trying to figure out how to create strm files. Also where are they stored and is it possible to store them in the cloud . Im using a Odroid c2 and Minix U-9 . I know strm are not large but I update my library daily so trying to save space that me generating strm would create. Any input , thanks in advance .
Question on security: is the connection to Google Drive via https? Wondering if I need to set up a VPN to keep the connection private.