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.3 (2025-10-10)
- Fix removing older Widevine CDM backups (@mediaminister)

### v0.8.2 (2025-09-25)
- Fix Widevine CDM installation on 32-bit Windows (@mediaminister)

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.2" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.3" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
<requires>
<!--py3 compliant-->
<import addon="xbmc.python" version="3.0.0"/>
Expand Down Expand Up @@ -27,6 +27,9 @@
<description lang="ru_RU">Простой модуль для Kodi, который облегчает жизнь разработчикам дополнений, с использованием InputStream дополнений и воспроизведения DRM контента.</description>
<description lang="sv_SE">En enkel Kodi-modul som underlättar livet för tilläggsutvecklare som förlitar sig på InputStream-baserade tillägg och DRM-uppspelning.</description>
<news>
v0.8.3 (2025-10-10)
- Fix removing older Widevine CDM backups

v0.8.2 (2025-09-25)
- Fix Widevine CDM installation on 32-bit Windows

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ def check_inputstream(self):
if get_setting_bool('disabled', False): # blindly return True if helper has been disabled
log(3, 'InputStreamHelper is disabled in its settings.xml.')
return True
if self.drm == 'widevine' and not self._supports_widevine():
return False
if not self._has_inputstream():
# Try to install InputStream add-on
if not self._install_inputstream():
Expand All @@ -448,6 +446,8 @@ def check_inputstream(self):
return False
self._enable_inputstream()
log(0, '{addon} {version} is installed and enabled.', addon=self.inputstream_addon, version=self._inputstream_version())
if self.drm == 'widevine' and not self._supports_widevine():
return False

if self.protocol == 'hls' and not self._supports_hls():
ok_dialog(localize(30004), # HLS Minimum version is needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
# 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: 2025-09-21
# current Chrome OS version: 16328.65.0, Widevine version: 4.10.2662.3
# Last updated: 2025-10-10
# current Chrome OS version: 16371.61.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
Expand All @@ -103,6 +103,7 @@
'hana',
'jacuzzi',
'kukui',
'rauru',
'staryu',
'strongbad',
'trogdor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,22 +363,25 @@ def open_file(path, flags='r'):
def copy(src, dest):
"""Copy a file (using xbmcvfs)"""
from xbmcvfs import copy as vfscopy
log(2, "Copy file '{src}' to '{dest}'.", src=src, dest=dest)
log(0, "Copy file '{src}' to '{dest}'.", src=src, dest=dest)
return vfscopy(from_unicode(src), from_unicode(dest))


def delete(path):
"""Remove a file (using xbmcvfs)"""
from xbmcvfs import delete as vfsdelete
log(2, "Delete file '{path}'.", path=path)
log(0, "Delete file '{path}'.", path=path)
return vfsdelete(from_unicode(path))


def exists(path):
"""Whether the path exists (using xbmcvfs)"""
# File or folder (folder must end with slash or backslash)
from xbmcvfs import exists as vfsexists
return vfsexists(from_unicode(path))
if vfsexists(from_unicode(path)):
log(0, "Path '{path}' exists.", path=path)
return True
return False


def listdir(path):
Expand All @@ -391,14 +394,14 @@ def listdir(path):
def mkdir(path):
"""Create a directory (using xbmcvfs)"""
from xbmcvfs import mkdir as vfsmkdir
log(2, "Create directory '{path}'.", path=path)
log(0, "Create directory '{path}'.", path=path)
return vfsmkdir(from_unicode(path))


def mkdirs(path):
"""Create directory including parents (using xbmcvfs)"""
from xbmcvfs import mkdirs as vfsmkdirs
log(2, "Recursively create directory '{path}'.", path=path)
log(0, "Recursively create directory '{path}'.", path=path)
return vfsmkdirs(from_unicode(path))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __eq__(self, other):

def temp_path():
"""Return temporary path, usually ~/.kodi/userdata/addon_data/script.module.inputstreamhelper/temp/"""
tmp_path = translate_path(os.path.join(get_setting('temp_path', 'special://masterprofile/addon_data/script.module.inputstreamhelper'), 'temp'))
tmp_path = translate_path(os.path.join(get_setting('temp_path', 'special://masterprofile/addon_data/script.module.inputstreamhelper'), 'temp', ''))
if not exists(tmp_path):
mkdirs(tmp_path)

Expand Down Expand Up @@ -388,7 +388,7 @@ def hardlink(src, dest):
link(compat_path(src), compat_path(dest))
except (AttributeError, OSError, ImportError):
return copy(src, dest)
log(2, "Hardlink file '{src}' to '{dest}'.", src=src, dest=dest)
log(0, "Hardlink file '{src}' to '{dest}'.", src=src, dest=dest)
return True


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def has_widevinecdm():
return True

widevinecdm = widevinecdm_path()
log(3, widevinecdm)
if widevinecdm is None:
return False
if not exists(widevinecdm):
Expand Down Expand Up @@ -178,6 +177,7 @@ def latest_widevine_version():
def remove_old_backups(bpath):
"""Removes old Widevine backups, if number of allowed backups is exceeded"""
max_backups = get_setting_int('backups', 4)
to_remove = []
versions = sorted([parse_version(version) for version in listdir(bpath)])

if len(versions) < 2:
Expand All @@ -186,13 +186,16 @@ def remove_old_backups(bpath):
try:
installed_version = load_widevine_config()['version']
except TypeError:
log(2, "could not determine installed version. Aborting cleanup of old versions.")
log(2, "Could not determine installed version. Aborting cleanup of old versions.")
return

while len(versions) > max_backups + 1:
remove_version = str(versions[1] if versions[0] == parse_version(installed_version) else versions[0])
log(0, 'Removing oldest backup which is not installed: {version}', version=remove_version)
remove_tree(os.path.join(bpath, remove_version))
versions = sorted([parse_version(version) for version in listdir(bpath)])
filtered = [v for v in versions if v != parse_version(installed_version)]

if len(filtered) > max_backups:
to_remove = filtered[: len(filtered) - max_backups]

for v in to_remove:
remove_version = str(v)
log(2, 'Removing old backup: {version}', version=remove_version)
remove_tree(os.path.join(bpath, remove_version, '')) # ensure trailing separator
return