plex-for-kodi icon indicating copy to clipboard operation
plex-for-kodi copied to clipboard

Unable to play multi part video in Kodi 19

Open JayXon opened this issue 3 years ago • 2 comments

Description:

I can play most videos just fine, but this video is splitted into two files, part1 and part2, and it will stuck after trying to play.

Details:

  • Add-on version: 0.3.3
  • Kodi version: 19.0
  • OS Platform: Android
  • Hardware: Shield

Checklist

  • [x] I have included a link to a log (or at the very least a link to a forum post with a log) from a session that had the issue
  • [ ] I have added appropriate GitHub labels
2021-05-16 00:11:37.483 T:14316   ERROR <general>: _________________________________________________________________________________
2021-05-16 00:11:37.484 T:14316   ERROR <general>: script.plex: ERROR: 
2021-05-16 00:11:37.484 T:14316   ERROR <general>:     Traceback (most recent call last):
2021-05-16 00:11:37.484 T:14316   ERROR <general>:       File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/player.py", line 745, in _playVideo
2021-05-16 00:11:37.484 T:14316   ERROR <general>:         self.playerObject = self.playerObject.getServerDecision()
2021-05-16 00:11:37.484 T:14316   ERROR <general>:       File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 201, in getServerDecision
2021-05-16 00:11:37.484 T:14316   ERROR <general>:         decisionPath = self.getDecisionPath(directPlay)
2021-05-16 00:11:37.484 T:14316   ERROR <general>:       File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 238, in getDecisionPath
2021-05-16 00:11:37.484 T:14316   ERROR <general>:         decisionPath = self.buildTranscode(server, util.AttributeDict(), self.metadata.partIndex, True, False).decisionPath
2021-05-16 00:11:37.484 T:14316   ERROR <general>:       File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 457, in buildTranscode
2021-05-16 00:11:37.484 T:14316   ERROR <general>:         seekOffset >= obj.startOffset and seekOffset <= obj.get('startOffset', 0) + int(part.duration.asInt() / 1000)
2021-05-16 00:11:37.484 T:14316   ERROR <general>:     TypeError: '>=' not supported between instances of 'int' and 'NoneType'
2021-05-16 00:11:37.484 T:14316   ERROR <general>: _________________________________________________________________________________
2021-05-16 00:11:37.484 T:14316   ERROR <general>: `
2021-05-16 00:11:37.484 T:14316 WARNING <general>: xbmc.translatePath is deprecated and might be removed in future kodi versions. Please use xbmcvfs.translatePath instead.
2021-05-16 00:11:37.491 T:14316   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'str' object has no attribute 'decode'
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/player.py", line 745, in _playVideo
                                                       self.playerObject = self.playerObject.getServerDecision()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 201, in getServerDecision
                                                       decisionPath = self.getDecisionPath(directPlay)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 238, in getDecisionPath
                                                       decisionPath = self.buildTranscode(server, util.AttributeDict(), self.metadata.partIndex, True, False).decisionPath
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexplayer.py", line 457, in buildTranscode
                                                       seekOffset >= obj.startOffset and seekOffset <= obj.get('startOffset', 0) + int(part.duration.asInt() / 1000)
                                                   TypeError: '>=' not supported between instances of 'int' and 'NoneType'
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/windows/kodigui.py", line 105, in onInit
                                                       self.onFirstInit()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/windows/videoplayer.py", line 91, in onFirstInit
                                                       self.play(resume=self.resume)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/windows/videoplayer.py", line 234, in play
                                                       player.PLAYER.playVideoPlaylist(self.playQueue, resume=self.resume, session_id=id(self), handler=handler)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/player.py", line 806, in playVideoPlaylist
                                                       self._playVideo(resume and self.video.viewOffset.asInt() or 0, seeking=handler and handler.SEEK_PLAYLIST or 0, force_update=True)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/player.py", line 750, in _playVideo
                                                       util.ERROR(notify=True)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/util.py", line 143, in ERROR
                                                       showNotification('ERROR: {0}'.format(short))
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.plex/lib/util.py", line 179, in showNotification
                                                       icon_path = icon_path or xbmc.translatePath(ADDON.getAddonInfo('icon')).decode('utf-8')
                                                   AttributeError: 'str' object has no attribute 'decode'
                                                   -->End of Python script error report<--

JayXon avatar May 16 '21 07:05 JayXon

https://github.com/plexinc/plex-for-kodi/blob/e6610e42ce1afd115cf59632b949e18597625323/lib/_included_packages/plexnet/plexplayer.py#L457 Looks like obj.startOffset needs to be obj.get('startOffset', 0)

JayXon avatar May 16 '21 07:05 JayXon

This is fixed in my fork: https://github.com/garymm/plex-for-kodi/commit/787b361bf58ff95e60e6625734a74776709017b5

Anyone should feel free to open a PR to fix it here too.

garymm avatar Sep 26 '22 16:09 garymm

Got merged into master, but not released: https://github.com/plexinc/plex-for-kodi/commit/ff3b4f233dd456beb3a440a234f7eec6a65ce976

garymm avatar Dec 03 '22 00:12 garymm

Submitted to Kodi repo.

ruuk avatar Dec 03 '22 02:12 ruuk