Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions script.module.inputstreamhelper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ Please report any issues or bug reports on the [GitHub Issues](https://github.co
This module is licensed under the **The MIT License**. Please see the [LICENSE.txt](LICENSE.txt) file for details.

## Releases
### v0.8.1 (2025-09-22)
- Fix Widevine CDM installation on ARM hardware (@mediaminister)

### v0.8.0 (2025-09-19)
- Fix Widevine CDM installation on Windows, Linux and Macintosh (@mediaminister)
- Add support for LG webOS (@Uukrull)
Expand Down
5 changes: 4 additions & 1 deletion script.module.inputstreamhelper/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.0" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.1" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
<requires>
<!--py3 compliant-->
<import addon="xbmc.python" version="3.0.0"/>
Expand All @@ -25,6 +25,9 @@
<description lang="hr_HR">Jednostavan Kodi modul koji olakšava razvijanje dodataka koji se temelje na InputStream dodatku i reprodukciji DRM zaštićenog sadržaja.</description>
<description lang="ru_RU">Простой модуль для Kodi, который облегчает жизнь разработчикам дополнений, с использованием InputStream дополнений и воспроизведения DRM контента.</description>
<news>
v0.8.1 (2025-09-22)
- Fix Widevine CDM installation on ARM hardware

v0.8.0 (2025-09-19)
- Fix Widevine CDM installation on Windows, Linux and Macintosh
- Add support for LG webOS
Expand Down
21 changes: 14 additions & 7 deletions script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _supports_widevine(self):
ok_dialog(localize(30004), localize(30007, arch=arch())) # Widevine not available on this architecture
return False

if arch() == 'arm64' and system_os() not in ['Android', 'Darwin'] and userspace64():
if arch() == 'arm64' and system_os() not in ['Android', 'Darwin', 'Windows'] and userspace64():
is_version = parse_version(addon_version(self.inputstream_addon))
try:
compat_version = parse_version(config.MINIMUM_INPUTSTREAM_VERSION_ARM64[self.inputstream_addon])
Expand Down Expand Up @@ -270,11 +270,12 @@ def remove_widevine():
"""Removes Widevine CDM"""
if has_widevinecdm():
widevinecdm = widevinecdm_path()
log(0, 'Removed Widevine CDM at {path}', path=widevinecdm)
delete(widevinecdm)
notification(localize(30037), localize(30052)) # Success! Widevine successfully removed.
set_setting('last_modified', '0.0')
return True
if widevinecdm:
log(0, 'Removed Widevine CDM at {path}', path=widevinecdm)
delete(widevinecdm)
notification(localize(30037), localize(30052)) # Success! Widevine successfully removed.
set_setting('last_modified', '0.0')
return True
notification(localize(30004), localize(30053)) # Error. Widevine CDM not found.
return False

Expand Down Expand Up @@ -361,7 +362,13 @@ def _check_widevine(self):

if cdm_from_repo(): # check that widevine arch matches system arch
wv_config = load_widevine_config()
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config['platforms'][0]['arch']:
if wv_config.get('accept_arch'):
wv_config_arch = wv_config.get('accept_arch')[0]
elif wv_config.get('platforms'):
wv_config_arch = wv_config.get('platforms')[0].get('arch')
else:
wv_config_arch = wv_config.get('arch')
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config_arch:
log(4, 'Widevine/system arch mismatch. Reinstall is required.')
ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required
return self.install_widevine()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
ARCH_MAP = {
'aarch64': 'arm64',
'aarch64_be': 'arm64',
'ARM64': 'arm64',
'AMD64': 'x86_64',
'armv7': 'arm',
'armv8': 'arm',
Expand Down Expand Up @@ -85,12 +86,11 @@
# To keep the Chrome OS ARM(64) hardware ID list up to date, the following resources can be used:
# https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
# https://chromiumdash.appspot.com/serving-builds?deviceCategory=Chrome%20OS
# Last updated: 2024-10-13
# current Chrome OS version: 16002.44.0, Widevine version: 4.10.2662.3
# Last updated: 2025-09-21
# current Chrome OS version: 16328.65.0, Widevine version: 4.10.2662.3
CHROMEOS_RECOVERY_ARM_BNAMES = [
'bob', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_bob_recovery_stable-channel_mp-v2.bin.zip
'elm', # probably 64bit soon. current: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15886.44.0_elm_recovery_stable-channel_mp-v6.bin.zip
'hana', # probably 64bit soon. current: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15964.59.0_hana_recovery_stable-channel_mp-v11.bin.zip
'kevin', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_kevin_recovery_stable-channel_mp-v2.bin.zip
'scarlet', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_scarlet_recovery_stable-channel_mp-v8.bin.zip
]
Expand All @@ -99,8 +99,11 @@
'asurada',
'cherry',
'corsola',
'geralt',
'hana',
'jacuzzi',
'kukui',
'staryu',
'strongbad',
'trogdor',
]
Expand Down
12 changes: 12 additions & 0 deletions script.module.inputstreamhelper/lib/inputstreamhelper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,18 @@ def userspace64():
return struct.calcsize('P') * 8 == 64


def elfbinary64(path):
"""To check if an ELF binary is 64bit or 32bit"""
with open(path, 'rb') as f:
f.seek(4) # skip 0x7F 'E' 'L' 'F'
b = f.read(1)
if b == b'\x01':
return False
if b == b'\x02':
return True
raise ValueError('Not a valid ELF class')


def hardlink(src, dest):
"""Hardlink a file when possible, copy when needed"""
if exists(dest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .. import config
from ..kodiutils import browsesingle, localize, log, ok_dialog, open_file, progress_dialog, yesno_dialog
from ..utils import diskspace, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64
from ..utils import diskspace, elfbinary64, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64
from .arm_chromeos import ChromeOSImage
from .arm_lacros import cdm_from_lacros, install_widevine_arm_lacros

Expand Down Expand Up @@ -138,11 +138,19 @@ def extract_widevine_chromeos(backup_path, image_path, image_version):
progress = progress_dialog()
progress.create(heading=localize(30043), message=localize(30044)) # Extracting Widevine CDM

filename = config.WIDEVINE_CDM_FILENAME[system_os()]
extract_path = os.path.join(backup_path, image_version)

extracted = ChromeOSImage(image_path, progress=progress).extract_file(
filename=config.WIDEVINE_CDM_FILENAME[system_os()],
extract_path=os.path.join(backup_path, image_version))
filename=filename,
extract_path=extract_path)

if not extracted:
if extracted:
if not userspace64() == elfbinary64(os.path.join(extract_path, filename)):
log(4, 'Widevine CDM userspace mismatch. Please check Chrome OS Recovery image userspace')
progress.close()
return False
else:
log(4, 'Extracting widevine from the zip failed!')
progress.close()
return False
Expand Down