@@ -15,7 +15,7 @@ def __init__(self, protocol, drm=None):
15
15
self ._addon = xbmcaddon .Addon ('script.module.inputstreamhelper' )
16
16
self ._logging_prefix = '[%s-%s]' % (self ._addon .getAddonInfo ('id' ), self ._addon .getAddonInfo ('version' ))
17
17
self ._language = self ._addon .getLocalizedString
18
- self ._arch = platform .machine ()
18
+ self ._arch = self . _get_arch ( platform .machine () )
19
19
self ._os = platform .system ()
20
20
self ._log ('Platform information: {0}' .format (platform .uname ()))
21
21
@@ -32,6 +32,12 @@ def __init__(self, protocol, drm=None):
32
32
class InputStreamException (Exception ):
33
33
pass
34
34
35
+ def _get_arch (self , arch ):
36
+ if arch in config .ARCHS :
37
+ return config .ARCHS [arch ]
38
+ else :
39
+ return arch
40
+
35
41
def _log (self , string ):
36
42
msg = '{0}: {1}' .format (self ._logging_prefix , string )
37
43
xbmc .log (msg = msg , level = xbmc .LOGDEBUG )
@@ -48,7 +54,7 @@ def _inputstream_version(self):
48
54
addon = xbmcaddon .Addon (self ._inputstream_addon )
49
55
return addon .getAddonInfo ('version' )
50
56
51
- def has_widevine_cdm (self ):
57
+ def _has_widevine_cdm (self ):
52
58
if xbmc .getCondVisibility ('system.platform.android' ): # widevine is built in on android
53
59
return True
54
60
else :
@@ -117,6 +123,28 @@ def _enable_inputstream(self):
117
123
else :
118
124
return True
119
125
126
+ def _supports_widevine (self ):
127
+ dialog = xbmcgui .Dialog ()
128
+ if xbmc .getCondVisibility ('system.platform.android' ):
129
+ min_version = config .WIDEVINE_ANDROID_MINIMUM_KODI_VERSION
130
+ else :
131
+ min_version = config .WIDEVINE_MINIMUM_KODI_VERSION
132
+
133
+ if self ._arch not in config .WIDEVINE_SUPPORTED_ARCHS :
134
+ dialog .ok (self ._language (30004 ), self ._language (30007 ))
135
+ return False
136
+ if self ._os not in config .WIDEVINE_SUPPORTED_OS :
137
+ dialog .ok (self ._language (30004 ), self ._language (30011 ).format (self ._os ))
138
+ return False
139
+ if LooseVersion (min_version ) > LooseVersion (self ._kodi_version ()):
140
+ dialog .ok (self ._language (30004 ), self ._language (30010 ).format (min_version ))
141
+ return False
142
+ if 'WindowsApps' in xbmc .translatePath ('special://xbmcbin/' ): # uwp is not supported
143
+ dialog .ok (self ._language (30004 ), self ._language (30012 ))
144
+ return False
145
+
146
+ return True
147
+
120
148
def check_for_inputstream (self ):
121
149
"""Ensures that selected InputStream add-on is installed and enabled.
122
150
Displays a select dialog if add-on is installed but not enabled."""
0 commit comments