kodi plex addon error fixed

plex is a cross platform video organization software and player

plex kodi addon is free.

but it has following error when start plex addon:

File "/private/var/mobile/Containers/Data/Application/E9C10B6B-E485–49DB-BABC-77CFC8EC3751/Library/Preferences/Kodi/addons/script.plex/lib/_included_packages/plexnet/util.py”, line 37, in <module>
X_PLEX_PLATFORM = platform.uname()[0] # Platform name, eg iOS, MacOSX, Android, LG, etc
File “/Users/Shared/jenkins/workspace/IOS-ARM64/tools/depends/xbmc-depends/iphoneos11.0_arm64-target-debug/lib/python2.7/platform.py”, line 1232, in uname
File “/Users/Shared/jenkins/workspace/IOS-ARM64/tools/depends/xbmc-depends/iphoneos11.0_arm64-target-debug/lib/python2.7/platform.py”, line 967, in _syscmd_uname
IOError: [Errno 10] No child processes

it is because the python code came with kodi has no method named ‘uname’ in platform.pyc

The fix is simple, just hard code the platform info, the problem can be fixed.

Kodi/addons/script.plex/lib/_included_packages/plexnet/util.py

X_PLEX_PLATFORM = ‘iOS’ #platform.uname()[0] # Platform name, eg iOS, MacOSX, Android, LG, etc
X_PLEX_PLATFORM_VERSION = ‘11.1.2’ #platform.uname()[2] # Operating system version, eg 4.3.1, 10.6.7, 3.2
$ git diff util.py
diff --git a/lib/_included_packages/plexnet/util.py b/lib/_included_packages/plexnet/util.py
index 143d576..b43c8bf 100644
--- a/lib/_included_packages/plexnet/util.py
+++ b/lib/_included_packages/plexnet/util.py
@@ -34,8 +34,8 @@ X_PLEX_CONTAINER_SIZE = 50 # max results to return in a
# Plex Header Configuation
X_PLEX_PROVIDES = 'player,controller' # one or more of [player, controller, server]
-X_PLEX_PLATFORM = platform.uname()[0] # Platform name, eg iOS, MacOSX, Android, LG, etc
-X_PLEX_PLATFORM_VERSION = platform.uname()[2] # Operating system version, eg 4.3.1, 10.6.7, 3.2
+X_PLEX_PLATFORM = 'iOS' #platform.uname()[0] # Platform name, eg iOS, MacOSX, Android, LG, etc
+X_PLEX_PLATFORM_VERSION = '12.1.1' #platform.uname()[2] # Operating system version, eg 4.3.1, 10.6.7, 3.2
X_PLEX_PRODUCT = PROJECT # Plex application name, eg Laika, Plex Media Server, Media Link
X_PLEX_VERSION = VERSION # Plex application version number
USER_AGENT = '{0}/{1}'.format(PROJECT, VERSION)

Kodi/addons/script.plex/lib/_included_packages/plexnet/plexapp.py +305

_globals = {
‘platform’: platform.uname()[0],
‘appVersionStr’: ‘0.0.0a1’,
‘clientIdentifier’: str(hex(uuid.getnode())),
‘platformVersion’: platform.uname()[2],
‘product’: ‘PlexNet.API’,
‘provides’: ‘player’,
‘device’: platform.uname()[0],
‘model’: ‘Unknown’,
‘friendlyName’: ‘PlexNet.API’,
‘deviceInfo’: DeviceInfo()
}
$ git diff plexapp.py
diff --git a/lib/_included_packages/plexnet/plexapp.py b/lib/_included_packages/plexnet/plexapp.py
index 089c05c..370e1eb 100644
--- a/lib/_included_packages/plexnet/plexapp.py
+++ b/lib/_included_packages/plexnet/plexapp.py
@@ -302,13 +302,13 @@ class DumbInterface(AppInterface):
None: {}
}
_globals = {
- 'platform': platform.uname()[0],
+ 'platform': 'iOS', #platform.uname()[0],
'appVersionStr': '0.0.0a1',
'clientIdentifier': str(hex(uuid.getnode())),
- 'platformVersion': platform.uname()[2],
+ 'platformVersion': '12.1.1', #platform.uname()[2],
'product': 'PlexNet.API',
'provides': 'player',
- 'device': platform.uname()[0],
+ 'device': 'iOS', #platform.uname()[0],
'model': 'Unknown',
'friendlyName': 'PlexNet.API',
'deviceInfo': DeviceInfo()

Kodi/addons/script.plex/lib/plex.py

‘friendlyName’: ‘Kodi Add-on iOS’, #({0})’.format(platform.node()),$ git diff
diff --git a/lib/plex.py b/lib/plex.py
index 4bb9fd2..9085b60 100644
--- a/lib/plex.py
+++ b/lib/plex.py
@@ -76,7 +76,7 @@ class PlexInterface(plexapp.AppInterface):
'provides': 'player',
'device': util.getPlatform() or plexapp.PLATFORM,
'model': 'Unknown',
- 'friendlyName': 'Kodi Add-on ({0})'.format(platform.node()),
+ 'friendlyName': 'Kodi Add-on iOS',
'supports1080p60': True,
'vp9Support': True,
'transcodeVideoQualities': [

https://github.com/myahmao/plex-for-kodi/commit/427ce50ef51ffb4cec829584d8beaf28fc3b0a65

自由撰稿人,时评人,平等公义追求者

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store