PlexKodiConnect: Kodi Plex Integration Done Right

Did a test install of this on my computer and it worked perfect, but when I try to use it on my FireTV2 it crashes immediately.

Kodi Debug Log:
DEBUG: static bool XFILE::CPluginDirectory::RunScriptWithParams(const string&) - calling plugin PlexKodiConnect(‘plugin://plugin.video.plexkodiconnect/’,’-1’,’?mode=reConnect’)
20:52:41 T:18446744072305676472 DEBUG: Thread LanguageInvoker start, auto delete: false
20:52:41 T:18446744072305676472 INFO: initializing python engine.
20:52:41 T:18446744072305676472 DEBUG: CPythonInvoker(2, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py): start processing
20:52:41 T:18446744072289628240 DEBUG: ------ Window Deinit (DialogAddonSettings.xml) ------
20:52:41 T:18446744072305676472 DEBUG: -->Python Interpreter Initialized<–
20:52:41 T:18446744072305676472 DEBUG: CPythonInvoker(2, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py): the source file to load is “/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py”
20:52:41 T:18446744072305676472 DEBUG: CPythonInvoker(2, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py): setting the Python path to /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect:/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.requests/lib:/:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python26.zip:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python2.6:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python2.6/plat-linux3:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python2.6/lib-tk:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python2.6/lib-old:/data/app/org.xbmc.kodi-1/base.apk/assets/python2.6/lib/python2.6/lib-dynload
20:52:41 T:18446744072305676472 DEBUG: CPythonInvoker(2, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py): entering source directory /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect
20:52:41 T:18446744072305676472 DEBUG: CPythonInvoker(2, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/default.py): instantiating addon using automatically obtained id of “plugin.video.plexkodiconnect” dependent on version 2.1.0 of the xbmc.python api
20:52:41 T:18446744072305676472 NOTICE: plugin.video.plexkodiconnect started
20:52:41 T:18446744072305676472 NOTICE: Full sys.argv received: [‘plugin://plugin.video.plexkodiconnect/’, ‘-1’, ‘?mode=reConnect’]
20:52:41 T:18446744072305676472 NOTICE: Parameter string: ?mode=reConnect
20:52:41 T:18446744072305676472 NOTICE: PlexKodiConnect entrypoint -> Connection resets requested
20:52:41 T:18446744072305676472 DEBUG: LocalizeStrings: no strings.po file exist at /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.plexkodiconnect/resources/language/English, fallback to strings.xml
20:52:41 T:18446744072305676472 NOTICE: PlexKodiConnect entrypoint -> Successfully stopped library sync
20:52:41 T:18446744072289628240 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
20:52:45 T:18446744072289628240 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------
20:52:47 T:18446744072289628240 DEBUG: ------ Window Init (DialogOK.xml) ------
20:52:47 T:18446744072289628240 INFO: Loading skin file: DialogOK.xml, load type: KEEP_IN_MEMORY
20:52:56 T:18446744072303313896 DEBUG: Thread JobWorker 18446744072303313896 terminating (autodelete)
20:52:56 T:18446744072302493736 DEBUG: Thread JobWorker 18446744072302493736 terminating (autodelete)
20:53:12 T:18446744072289628240 DEBUG: SECTION:UnloadDelayed(DLL: libImageLib-arm.so)

Can’t seem to find add-on’s log, anyone know where it is?

So guys, hopefully ironed out some bugs. In a nutshell:

  • Startup crashes should all be fixed
  • Movie information not showing up is fixed. Took me ages to find a single line of code :frowning:
  • If your PMS doesn’t like the strain PKC is putting on it during initial sync, PKC will now cancel the sync process (I’m looking at you, @bart.plessers ;-)). I haven’t managed to do that - please report back!
  • Rewired Plex Companion. God, that was a mess
  • Talking with the outside world is now done in one function. Should make future fixes quicker

The new background sync process should work, too. If you view something outside of Kodi/PKC, this is almost instantly detected by PKC. However, due to the nature of how Plex works, the following is (and will probably never be) possible to detect instantly:

  • Toggle the viewstate of an item to (un)watched outside of Kodi
  • Changing details of an item, e.g. replacing a poster
    However, some changes to individual items are instantly detected, e.g. if you match a yet unrecognized movie.

Download: Releases · croneter/PlexKodiConnect · GitHub

##Changelog##
version 1.1.1
(you will need to rescan your library)

  • Fix Kodi information screen not working
  • Fix entire TV shows showing up as watched
  • Clear playlists and video nodes on user switch
  • Update playstate if owner plays for single user PMS
  • Deal with PMS reply 401 under too much strain
  • Fix Library Repair Sync
  • Rewired downloads and connecting to PMS
  • Shut down libsync more cleanly if interrupted
  • Use Plex library for timesync
  • Try 3x before declaring plex connection dead
  • Plex Companion cleanup (e.g. fix instance chaos)
  • Fix TypeError with PMS item ‘addedAt’ missing

big hands up for @croneter !

1.1.1 Working in FTV Stick, btw kodi 16 titan skin with os 5.05 is slowwwwww…

Still have same issues as earlier reported wih log when switching between 2 Kodi profiles. Switching between profiles leads to PKC eventually not keeping up with the logins, nodes being wiped out for widgets, and eventually errors out when trying to play something. Rebooting will fix widgets and all functionality until switching profiles.

I can however say that movie info screen is popping up again for me.

Fresh install, but getting a check logs for error message on fire tv.

xbmclogs.com/pmcbzxabu

@Silvaire said:
Still have same issues as earlier reported wih log when switching between 2 Kodi profiles. Switching between profiles leads to PKC eventually not keeping up with the logins, nodes being wiped out for widgets, and eventually errors out when trying to play something. Rebooting will fix widgets and all functionality until switching profiles.

I can however say that movie info screen is popping up again for me.

How many times and how fast are you actually switching profiles? Switching once in a while within minutes seems more reasonable and practical than switching within a couple of seconds… :stuck_out_tongue:

@dspayne1 said:
Fresh install, but getting a check logs for error message on fire tv.

xbmclogs.com/pmcbzxabu

Thanks for the log, will look into it

@croneter said:

@Silvaire said:
Still have same issues as earlier reported wih log when switching between 2 Kodi profiles. Switching between profiles leads to PKC eventually not keeping up with the logins, nodes being wiped out for widgets, and eventually errors out when trying to play something. Rebooting will fix widgets and all functionality until switching profiles.

I can however say that movie info screen is popping up again for me.

How many times and how fast are you actually switching profiles? Switching once in a while within minutes seems more reasonable and practical than switching within a couple of seconds… :stuck_out_tongue:

Tends to happen on the first switch – or at the very least widgets/nodes become broken on the first switch. Only reason I continue to swap back and forth is to do more testing for you to see where the pressure points are. I’ll send you another log by PM in a bit but preliminary results are it is the same behavior as 1.0.17. Thanks.

Still getting the same Kodi-Log-Error on startup as with 1.1.0

Latest working version for me still is 1.0.17
Log

@croneter said:

The new background sync process should work, too. If you view something outside of Kodi/PKC, this is almost instantly detected by PKC. However, due to the nature of how Plex works, the following is (and will probably never be) possible to detect instantly:

  • Toggle the viewstate of an item to (un)watched outside of Kodi
  • Changing details of an item, e.g. replacing a poster
    However, some changes to individual items are instantly detected, e.g. if you match a yet unrecognized movie.

Seems to be working well so far @croneter. It does seem to be hanging up on exit though. Don’t have time to get you logs atm but will do so later.

So you don’t think we will ever see PKC being able to update instantly when new content is added? It used to do that but that was probably because of the constant polling. I just tried it and newly added content only show up after a full scan (30 minutes or restart).

First version in which I can use Plex.tv/pin. No local IP needed anymore.

Great

I am sure the answer is no…

Is adding plexbmc ok yo just get play lists??

@bigbadrabbit said:
Still getting the same Kodi-Log-Error on startup as with 1.1.0

Latest working version for me still is 1.0.17
Log

same problem here, seems to be a Mac OSX related issue.

@croneter Just some feedback that 1.1.1 is working perfectly for me. It has resolved the initial connection error I was seeing on the last revision. No issues on exit, or any others to report so a big thank you for your hard work.

A quick question. I don’t keep Kodi running all the time, it’s on my android tv so I quit when done. I’m not that bothered about Kodi detecting changes the second they happen. So should I leave the constant background sync on or is it better to disable. Any advantage or disadvantage?

Same here, last working version 1.0.17

Getting the error “AttributeError: _ElementInterface instance has no attribute ‘iter’” when trying to signin
Here are my logs : http://xbmclogs.com/piph5wm2z
I hope it helps !

Another showstopper bug: when my wife tries to play stuff on her account, she keeps getting prompted to log in, and when she logs in, it says unauthorized. Happens over and over again and through reboots. Also freezes KODI.

@TheMystery said:
I am using version 1.0.16, in plex and plexpy i now see what is playing.

But if i watch live tv then the last played episode / movie shows up as running in plex and plexpy, but nothing is played on that moment from plex.
Is this a known problem?

@croneter, with version 1.1.1 i have stil this problem when i watch live tv.
Have you an idea what the problem can be?

@Silvaire said:
Another showstopper bug: when my wife tries to play stuff on her account, she keeps getting prompted to log in, and when she logs in, it says unauthorized. Happens over and over again and through reboots. Also freezes KODI.

That’s something new. Could you please send me debug logs (turned on in PKC settings) showing this?

@hstamas said:

@croneter said:

The new background sync process should work, too. If you view something outside of Kodi/PKC, this is almost instantly detected by PKC. However, due to the nature of how Plex works, the following is (and will probably never be) possible to detect instantly:

  • Toggle the viewstate of an item to (un)watched outside of Kodi
  • Changing details of an item, e.g. replacing a poster
    However, some changes to individual items are instantly detected, e.g. if you match a yet unrecognized movie.

Seems to be working well so far @croneter. It does seem to be hanging up on exit though. Don’t have time to get you logs atm but will do so later.

So you don’t think we will ever see PKC being able to update instantly when new content is added? It used to do that but that was probably because of the constant polling. I just tried it and newly added content only show up after a full scan (30 minutes or restart).

New content should still show up within approx. 1min. Sync of watch status works?