File tree Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Original file line number Diff line number Diff line change 18
18
'i686' : 'x86'
19
19
}
20
20
21
- WIDEVINE_DOWNLOAD_MAP = {
21
+ WIDEVINE_ARCH_MAP = {
22
22
'x86_64' :
23
23
{
24
- 'Linux' : 'Linux_x86_64-gcc3' ,
25
- 'Windows' : 'WINNT_x86-msvc' ,
26
- 'Darwin' : 'Darwin_x86_64-gcc3-u-i386-x86_64' },
24
+ 'Linux' : 'x64' ,
25
+ 'Windows' : 'ia32' ,
26
+ 'Darwin' : 'x64'
27
+ },
27
28
'x86' :
28
29
{
29
- 'Linux' : 'Linux_x86-gcc3 ' ,
30
- 'Windows' : 'WINNT_x86-msvc ' ,
31
- 'Darwin' : 'Darwin_x86_64-gcc3-u-i386-x86_64 '
30
+ 'Linux' : 'ia32 ' ,
31
+ 'Windows' : 'ia32 ' ,
32
+ 'Darwin' : 'ia32 '
32
33
}
33
34
}
34
35
36
+ WIDEVINE_OS_MAP = {
37
+ 'Linux' : 'linux' ,
38
+ 'Windows' : 'win' ,
39
+ 'Darwin' : 'mac'
40
+ }
41
+
35
42
WIDEVINE_CDM_EXTENSIONS = (
36
43
'.so' ,
37
44
'.dll' ,
68
75
69
76
WIDEVINE_MINIMUM_KODI_VERSION = '17.4'
70
77
71
- WIDEVINE_CDM_SOURCE = 'https://hg.mozilla.org/mozilla-central/raw-file/31465a03c03d1eec31cd4dd5d6b803724dcb29cd/toolkit/content/gmp-sources/widevinecdm.json'
78
+ WIDEVINE_CURRENT_VERSION_URL = 'https://dl.google.com/widevine-cdm/current.txt'
79
+
80
+ WIDEVINE_DOWNLOAD_URL = 'https://dl.google.com/widevine-cdm/{0}-{1}-{2}.zip'
72
81
73
82
HLS_MINIMUM_IA_VERSION = '2.0.10'
Original file line number Diff line number Diff line change @@ -194,17 +194,22 @@ def _supports_widevine(self):
194
194
195
195
return True
196
196
197
+ def _current_widevine_cdm_version (self ):
198
+ return self ._http_request (config .WIDEVINE_CURRENT_VERSION_URL )
199
+
197
200
def _install_widevine_cdm (self ):
198
201
dialog = xbmcgui .Dialog ()
199
202
if self ._arch in config .WIDEVINE_DOWNLOAD_UNAVAILABLE :
200
203
dialog .ok (self ._language (30001 ), self ._language (30006 ))
201
204
return False
205
+
202
206
download_path = os .path .join (xbmc .translatePath ('special://temp' ), 'widevine_cdm.zip' )
203
- cdm_platform = config .WIDEVINE_DOWNLOAD_MAP [self ._arch ][self ._os ]
204
- cdm_source = json .loads (self ._http_request (config .WIDEVINE_CDM_SOURCE ))['vendors' ]['gmp-widevinecdm' ]['platforms' ]
205
- cdm_zip_url = cdm_source [cdm_platform ]['fileUrl' ]
207
+ cdm_version = self ._current_widevine_cdm_version ()
208
+ cdm_os = config .WIDEVINE_OS_MAP [self ._os ]
209
+ cdm_arch = config .WIDEVINE_ARCH_MAP [self ._arch ][self ._os ]
210
+ cdm_url = config .WIDEVINE_DOWNLOAD_URL .format (cdm_version , cdm_os , cdm_arch )
206
211
207
- downloaded = self ._http_request (cdm_zip_url , download = True , download_path = download_path )
212
+ downloaded = self ._http_request (cdm_url , download = True , download_path = download_path )
208
213
if downloaded :
209
214
if self ._unzip_widevine_cdm (download_path ):
210
215
dialog .ok (self ._language (30001 ), self ._language (30003 ))
You can’t perform that action at this time.
0 commit comments