Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 43c6905

Browse files
Fix installing arm64 Widevine CDM on Win and Mac (#604)
1 parent 848d26d commit 43c6905

File tree

8 files changed

+128
-18
lines changed

8 files changed

+128
-18
lines changed

‎lib/inputstreamhelper/__init__.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _supports_widevine(self):
141141
ok_dialog(localize(30004), localize(30007, arch=arch())) # Widevine not available on this architecture
142142
return False
143143

144-
if arch() == 'arm64' and system_os() not in ['Android', 'Darwin'] and userspace64():
144+
if arch() == 'arm64' and system_os() not in ['Android', 'Darwin', 'Windows'] and userspace64():
145145
is_version = parse_version(addon_version(self.inputstream_addon))
146146
try:
147147
compat_version = parse_version(config.MINIMUM_INPUTSTREAM_VERSION_ARM64[self.inputstream_addon])
@@ -361,7 +361,13 @@ def _check_widevine(self):
361361

362362
if cdm_from_repo(): # check that widevine arch matches system arch
363363
wv_config = load_widevine_config()
364-
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config['platforms'][0]['arch']:
364+
if wv_config.get('accept_arch'):
365+
wv_config_arch = wv_config.get('accept_arch')[0]
366+
elif wv_config.get('platforms'):
367+
wv_config_arch = wv_config.get('platforms')[0].get('arch')
368+
else:
369+
wv_config_arch = wv_config.get('arch')
370+
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config_arch:
365371
log(4, 'Widevine/system arch mismatch. Reinstall is required.')
366372
ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required
367373
return self.install_widevine()

‎lib/inputstreamhelper/config.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
ARCH_MAP = {
2727
'aarch64': 'arm64',
2828
'aarch64_be': 'arm64',
29+
'ARM64': 'arm64',
2930
'AMD64': 'x86_64',
3031
'armv7': 'arm',
3132
'armv8': 'arm',

‎tests/test_ishelper_linux_x64.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
32
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
43

54
# pylint: disable=missing-docstring
@@ -21,32 +20,30 @@ class LinuxX64Tests(unittest.TestCase):
2120
def setUp(self):
2221
delete_cached()
2322
cleanup()
23+
inputstreamhelper.system_os = lambda: 'Linux'
24+
inputstreamhelper.widevine.repo.system_os = lambda: 'Linux'
2425

2526
def test_check_inputstream_mpd(self):
26-
inputstreamhelper.system_os = lambda: 'Linux'
2727
platform.machine = lambda: 'x86_64'
2828
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
2929
is_helper.remove_widevine()
3030
is_installed = is_helper.check_inputstream()
3131
self.assertTrue(is_installed, True)
3232

3333
def test_check_inputstream_hls_again(self):
34-
inputstreamhelper.system_os = lambda: 'Linux'
3534
platform.machine = lambda: 'AMD64'
3635
platform.architecture = lambda: ['64bit', '']
3736
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
3837
is_installed = is_helper.check_inputstream()
3938
self.assertTrue(is_installed, True)
4039

4140
def test_check_inputstream_rtmp(self):
42-
inputstreamhelper.system_os = lambda: 'Linux'
4341
platform.machine = lambda: 'x86_64'
4442
is_helper = inputstreamhelper.Helper('rtmp')
4543
is_installed = is_helper.check_inputstream()
4644
self.assertTrue(is_installed, True)
4745

4846
def test_check_inputstream_disabled(self):
49-
inputstreamhelper.system_os = lambda: 'Linux'
5047
platform.machine = lambda: 'x86_64'
5148
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
5249
is_helper.disable()

‎tests/test_ishelper_macos_arm64.py‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3+
4+
# pylint: disable=missing-docstring
5+
6+
import unittest
7+
import platform
8+
9+
import inputstreamhelper
10+
from test_utils import delete_cached, cleanup
11+
12+
xbmc = __import__('xbmc')
13+
xbmcaddon = __import__('xbmcaddon')
14+
xbmcgui = __import__('xbmcgui')
15+
xbmcvfs = __import__('xbmcvfs')
16+
17+
18+
class DarwinARM64Tests(unittest.TestCase):
19+
20+
def setUp(self):
21+
delete_cached()
22+
cleanup()
23+
inputstreamhelper.system_os = lambda: 'Darwin'
24+
inputstreamhelper.widevine.repo.system_os = lambda: 'Darwin'
25+
26+
def test_check_inputstream_mpd(self):
27+
platform.machine = lambda: 'arm64'
28+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
29+
is_helper.remove_widevine()
30+
is_installed = is_helper.check_inputstream()
31+
self.assertTrue(is_installed, True)
32+
33+
def test_check_inputstream_hls_again(self):
34+
platform.machine = lambda: 'arm64'
35+
platform.architecture = lambda: ['64bit', '']
36+
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
37+
is_installed = is_helper.check_inputstream()
38+
self.assertTrue(is_installed, True)
39+
40+
def test_check_inputstream_rtmp(self):
41+
platform.machine = lambda: 'arm64'
42+
is_helper = inputstreamhelper.Helper('rtmp')
43+
is_installed = is_helper.check_inputstream()
44+
self.assertTrue(is_installed, True)
45+
46+
def test_check_inputstream_disabled(self):
47+
platform.machine = lambda: 'arm64'
48+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
49+
is_helper.disable()
50+
is_installed = is_helper.check_inputstream()
51+
is_helper.enable()
52+
self.assertTrue(is_installed, True)
53+
54+
55+
if __name__ == '__main__':
56+
unittest.main()

‎tests/test_ishelper_macos_x64.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
32
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
43

54
# pylint: disable=missing-docstring
@@ -21,32 +20,30 @@ class DarwinX64Tests(unittest.TestCase):
2120
def setUp(self):
2221
delete_cached()
2322
cleanup()
23+
inputstreamhelper.system_os = lambda: 'Darwin'
24+
inputstreamhelper.widevine.repo.system_os = lambda: 'Darwin'
2425

2526
def test_check_inputstream_mpd(self):
26-
inputstreamhelper.system_os = lambda: 'Darwin'
2727
platform.machine = lambda: 'x86_64'
2828
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
2929
is_helper.remove_widevine()
3030
is_installed = is_helper.check_inputstream()
3131
self.assertTrue(is_installed, True)
3232

3333
def test_check_inputstream_hls_again(self):
34-
inputstreamhelper.system_os = lambda: 'Darwin'
3534
platform.machine = lambda: 'AMD64'
3635
platform.architecture = lambda: ['64bit', '']
3736
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
3837
is_installed = is_helper.check_inputstream()
3938
self.assertTrue(is_installed, True)
4039

4140
def test_check_inputstream_rtmp(self):
42-
inputstreamhelper.system_os = lambda: 'Darwin'
4341
platform.machine = lambda: 'x86_64'
4442
is_helper = inputstreamhelper.Helper('rtmp')
4543
is_installed = is_helper.check_inputstream()
4644
self.assertTrue(is_installed, True)
4745

4846
def test_check_inputstream_disabled(self):
49-
inputstreamhelper.system_os = lambda: 'Darwin'
5047
platform.machine = lambda: 'x86_64'
5148
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
5249
is_helper.disable()

‎tests/test_ishelper_windows_arm64.py‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3+
4+
# pylint: disable=missing-docstring
5+
6+
import unittest
7+
import platform
8+
9+
10+
import inputstreamhelper
11+
from test_utils import delete_cached, cleanup
12+
13+
xbmc = __import__('xbmc')
14+
xbmcaddon = __import__('xbmcaddon')
15+
xbmcgui = __import__('xbmcgui')
16+
xbmcvfs = __import__('xbmcvfs')
17+
18+
19+
class WindowsARM64Tests(unittest.TestCase):
20+
21+
def setUp(self):
22+
delete_cached()
23+
cleanup()
24+
inputstreamhelper.system_os = lambda: 'Windows'
25+
inputstreamhelper.widevine.repo.system_os = lambda: 'Windows'
26+
27+
def test_check_inputstream_mpd(self):
28+
platform.machine = lambda: 'ARM64'
29+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
30+
is_helper.remove_widevine()
31+
is_installed = is_helper.check_inputstream()
32+
self.assertTrue(is_installed, True)
33+
34+
def test_check_inputstream_hls_again(self):
35+
platform.machine = lambda: 'ARM64'
36+
platform.architecture = lambda: ['64bit', '']
37+
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
38+
is_installed = is_helper.check_inputstream()
39+
self.assertTrue(is_installed, True)
40+
41+
def test_check_inputstream_rtmp(self):
42+
platform.machine = lambda: 'ARM64'
43+
is_helper = inputstreamhelper.Helper('rtmp')
44+
is_installed = is_helper.check_inputstream()
45+
self.assertTrue(is_installed, True)
46+
47+
def test_check_inputstream_disabled(self):
48+
platform.machine = lambda: 'ARM64'
49+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
50+
is_helper.disable()
51+
is_installed = is_helper.check_inputstream()
52+
is_helper.enable()
53+
self.assertTrue(is_installed, True)
54+
55+
56+
if __name__ == '__main__':
57+
unittest.main()

‎tests/test_ishelper_windows_x64.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,30 @@ class WindowsX64Tests(unittest.TestCase):
2121
def setUp(self):
2222
delete_cached()
2323
cleanup()
24+
inputstreamhelper.system_os = lambda: 'Windows'
25+
inputstreamhelper.widevine.repo.system_os = lambda: 'Windows'
2426

2527
def test_check_inputstream_mpd(self):
26-
inputstreamhelper.system_os = lambda: 'Windows'
2728
platform.machine = lambda: 'x86_64'
2829
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
2930
is_helper.remove_widevine()
3031
is_installed = is_helper.check_inputstream()
3132
self.assertTrue(is_installed, True)
3233

3334
def test_check_inputstream_hls_again(self):
34-
inputstreamhelper.system_os = lambda: 'Windows'
3535
platform.machine = lambda: 'AMD64'
3636
platform.architecture = lambda: ['64bit', '']
3737
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
3838
is_installed = is_helper.check_inputstream()
3939
self.assertTrue(is_installed, True)
4040

4141
def test_check_inputstream_rtmp(self):
42-
inputstreamhelper.system_os = lambda: 'Windows'
4342
platform.machine = lambda: 'x86_64'
4443
is_helper = inputstreamhelper.Helper('rtmp')
4544
is_installed = is_helper.check_inputstream()
4645
self.assertTrue(is_installed, True)
4746

4847
def test_check_inputstream_disabled(self):
49-
inputstreamhelper.system_os = lambda: 'Windows'
5048
platform.machine = lambda: 'x86_64'
5149
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
5250
is_helper.disable()

‎tests/xbmcaddon.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ def getSetting(self, key):
3636
def getSettingBool(self, key):
3737
"""A working implementation for the xbmcaddon Addon class getSettingBool() method"""
3838
try:
39-
print(self.settings.get(key, False))
40-
print(bool(self.settings.get(key, False)))
4139
return bool(self.settings.get(key, False))
4240
except ValueError:
4341
return None

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /