@@ -174,15 +174,19 @@ def _supports_widevine(self):
174
174
min_version = config .WIDEVINE_MINIMUM_KODI_VERSION
175
175
176
176
if self ._arch not in config .WIDEVINE_SUPPORTED_ARCHS :
177
+ self ._log ('Unsupported Widevine architecture found: {0}' .format (self ._arch ))
177
178
dialog .ok (self ._language (30004 ), self ._language (30007 ))
178
179
return False
179
180
if self ._os not in config .WIDEVINE_SUPPORTED_OS :
181
+ self ._log ('Unsupported Widevine OS found: {0}' .format (self ._os ))
180
182
dialog .ok (self ._language (30004 ), self ._language (30011 ).format (self ._os ))
181
183
return False
182
184
if LooseVersion (min_version ) > LooseVersion (self ._kodi_version ()):
185
+ self ._log ('Unsupported Kodi version for Widevine: {0}' .format (self ._kodi_version ()))
183
186
dialog .ok (self ._language (30004 ), self ._language (30010 ).format (min_version ))
184
187
return False
185
188
if 'WindowsApps' in xbmc .translatePath ('special://xbmcbin/' ): # uwp is not supported
189
+ self .log ('Unsupported UWP Kodi version detected.' )
186
190
dialog .ok (self ._language (30004 ), self ._language (30012 ))
187
191
return False
188
192
@@ -192,8 +196,7 @@ def _install_widevine_cdm(self):
192
196
dialog = xbmcgui .Dialog ()
193
197
download_path = os .path .join (xbmc .translatePath ('special://temp' ), 'widevine_cdm.zip' )
194
198
cdm_platform = config .WIDEVINE_DOWNLOAD_MAP [self ._arch ][self ._os ]
195
- cdm_source = json .loads (self ._http_request (config .WIDEVINE_CDM_SOURCE ))['vendors' ]['gmp-widevinecdm' ][
196
- 'platforms' ]
199
+ cdm_source = json .loads (self ._http_request (config .WIDEVINE_CDM_SOURCE ))['vendors' ]['gmp-widevinecdm' ]['platforms' ]
197
200
cdm_zip_url = cdm_source [cdm_platform ]['fileUrl' ]
198
201
199
202
downloaded = self ._http_request (cdm_zip_url , download = True , download_path = download_path )
@@ -211,16 +214,19 @@ def _unzip_widevine_cdm(self, zip_path):
211
214
busy_dialog .create ()
212
215
for filename in zip_obj .namelist ():
213
216
if filename .endswith (config .WIDEVINE_CDM_EXTENSIONS ):
217
+ self ._log ('Widevine CDM found at: {0}' .format (os .path .join (zip_path , filename )))
214
218
zip_obj .extract (filename , self ._cdm_path ())
215
219
busy_dialog .close ()
216
220
return True
217
221
218
222
busy_dialog .close ()
219
223
dialog = xbmcgui .Dialog ()
220
224
dialog .ok (self ._language (30004 ), self ._language (30016 ))
225
+ self ._log ('Failed to find Widevine CDM file in {0}' .format (zip_path ))
221
226
return False
222
227
223
228
def check_for_drm (self ):
229
+ """Main function for ensuring that specified DRM system is installed and available."""
224
230
if self .drm :
225
231
if self .drm == 'widevine' :
226
232
if not self ._supports_widevine ():
@@ -235,9 +241,8 @@ def check_for_drm(self):
235
241
236
242
return True
237
243
238
- def check_for_inputstream (self ):
239
- """Ensures that selected InputStream add-on is installed, enabled and
240
- that specified DRM system is installed."""
244
+ def check_inputstream (self ):
245
+ """Main function. Ensures that all components are available for InputStream add-on playback."""
241
246
dialog = xbmcgui .Dialog ()
242
247
if not self ._has_inputstream ():
243
248
self ._log ('{0} is not installed.' .format (self ._inputstream_addon ))
@@ -262,4 +267,5 @@ def supports_hls(self):
262
267
if self .protocol == 'hls' and LooseVersion (self ._inputstream_version ()) >= LooseVersion (config .HLS_MINIMUM_IA_VERSION ):
263
268
return True
264
269
else :
270
+ self ._log ('HLS is not supported on {0} version {1}' .format (self ._inputstream_addon ), self ._inputstream_version ())
265
271
return False
0 commit comments