Skip to content

Commit 9a7b05e

Browse files
[script.module.inputstreamhelper] 0.8.3 (#2774)
1 parent 7552e22 commit 9a7b05e

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

script.module.inputstreamhelper/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Please report any issues or bug reports on the [GitHub Issues](https://github.co
9090
This module is licensed under the **The MIT License**. Please see the [LICENSE.txt](LICENSE.txt) file for details.
9191

9292
## Releases
93+
### v0.8.3 (2025-10-10)
94+
- Fix removing older Widevine CDM backups (@mediaminister)
95+
9396
### v0.8.2 (2025-09-25)
9497
- Fix Widevine CDM installation on 32-bit Windows (@mediaminister)
9598

script.module.inputstreamhelper/addon.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.2" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
2+
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.3" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
33
<requires>
44
<!--py3 compliant-->
55
<import addon="xbmc.python" version="3.0.0"/>
@@ -27,6 +27,9 @@
2727
<description lang="ru_RU">Простой модуль для Kodi, который облегчает жизнь разработчикам дополнений, с использованием InputStream дополнений и воспроизведения DRM контента.</description>
2828
<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>
2929
<news>
30+
v0.8.3 (2025-10-10)
31+
- Fix removing older Widevine CDM backups
32+
3033
v0.8.2 (2025-09-25)
3134
- Fix Widevine CDM installation on 32-bit Windows
3235

script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,6 @@ def check_inputstream(self):
435435
if get_setting_bool('disabled', False): # blindly return True if helper has been disabled
436436
log(3, 'InputStreamHelper is disabled in its settings.xml.')
437437
return True
438-
if self.drm == 'widevine' and not self._supports_widevine():
439-
return False
440438
if not self._has_inputstream():
441439
# Try to install InputStream add-on
442440
if not self._install_inputstream():
@@ -448,6 +446,8 @@ def check_inputstream(self):
448446
return False
449447
self._enable_inputstream()
450448
log(0, '{addon} {version} is installed and enabled.', addon=self.inputstream_addon, version=self._inputstream_version())
449+
if self.drm == 'widevine' and not self._supports_widevine():
450+
return False
451451

452452
if self.protocol == 'hls' and not self._supports_hls():
453453
ok_dialog(localize(30004), # HLS Minimum version is needed

script.module.inputstreamhelper/lib/inputstreamhelper/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
# To keep the Chrome OS ARM(64) hardware ID list up to date, the following resources can be used:
8787
# https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
8888
# https://chromiumdash.appspot.com/serving-builds?deviceCategory=Chrome%20OS
89-
# Last updated: 2025-09-21
90-
# current Chrome OS version: 16328.65.0, Widevine version: 4.10.2662.3
89+
# Last updated: 2025-10-10
90+
# current Chrome OS version: 16371.61.0, Widevine version: 4.10.2662.3
9191
CHROMEOS_RECOVERY_ARM_BNAMES = [
9292
'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
9393
'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
@@ -103,6 +103,7 @@
103103
'hana',
104104
'jacuzzi',
105105
'kukui',
106+
'rauru',
106107
'staryu',
107108
'strongbad',
108109
'trogdor',

script.module.inputstreamhelper/lib/inputstreamhelper/kodiutils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,22 +363,25 @@ def open_file(path, flags='r'):
363363
def copy(src, dest):
364364
"""Copy a file (using xbmcvfs)"""
365365
from xbmcvfs import copy as vfscopy
366-
log(2, "Copy file '{src}' to '{dest}'.", src=src, dest=dest)
366+
log(0, "Copy file '{src}' to '{dest}'.", src=src, dest=dest)
367367
return vfscopy(from_unicode(src), from_unicode(dest))
368368

369369

370370
def delete(path):
371371
"""Remove a file (using xbmcvfs)"""
372372
from xbmcvfs import delete as vfsdelete
373-
log(2, "Delete file '{path}'.", path=path)
373+
log(0, "Delete file '{path}'.", path=path)
374374
return vfsdelete(from_unicode(path))
375375

376376

377377
def exists(path):
378378
"""Whether the path exists (using xbmcvfs)"""
379379
# File or folder (folder must end with slash or backslash)
380380
from xbmcvfs import exists as vfsexists
381-
return vfsexists(from_unicode(path))
381+
if vfsexists(from_unicode(path)):
382+
log(0, "Path '{path}' exists.", path=path)
383+
return True
384+
return False
382385

383386

384387
def listdir(path):
@@ -391,14 +394,14 @@ def listdir(path):
391394
def mkdir(path):
392395
"""Create a directory (using xbmcvfs)"""
393396
from xbmcvfs import mkdir as vfsmkdir
394-
log(2, "Create directory '{path}'.", path=path)
397+
log(0, "Create directory '{path}'.", path=path)
395398
return vfsmkdir(from_unicode(path))
396399

397400

398401
def mkdirs(path):
399402
"""Create directory including parents (using xbmcvfs)"""
400403
from xbmcvfs import mkdirs as vfsmkdirs
401-
log(2, "Recursively create directory '{path}'.", path=path)
404+
log(0, "Recursively create directory '{path}'.", path=path)
402405
return vfsmkdirs(from_unicode(path))
403406

404407

script.module.inputstreamhelper/lib/inputstreamhelper/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __eq__(self, other):
4949

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

@@ -388,7 +388,7 @@ def hardlink(src, dest):
388388
link(compat_path(src), compat_path(dest))
389389
except (AttributeError, OSError, ImportError):
390390
return copy(src, dest)
391-
log(2, "Hardlink file '{src}' to '{dest}'.", src=src, dest=dest)
391+
log(0, "Hardlink file '{src}' to '{dest}'.", src=src, dest=dest)
392392
return True
393393

394394

script.module.inputstreamhelper/lib/inputstreamhelper/widevine/widevine.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def has_widevinecdm():
9797
return True
9898

9999
widevinecdm = widevinecdm_path()
100-
log(3, widevinecdm)
101100
if widevinecdm is None:
102101
return False
103102
if not exists(widevinecdm):
@@ -178,6 +177,7 @@ def latest_widevine_version():
178177
def remove_old_backups(bpath):
179178
"""Removes old Widevine backups, if number of allowed backups is exceeded"""
180179
max_backups = get_setting_int('backups', 4)
180+
to_remove = []
181181
versions = sorted([parse_version(version) for version in listdir(bpath)])
182182

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

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

194+
if len(filtered) > max_backups:
195+
to_remove = filtered[: len(filtered) - max_backups]
196+
197+
for v in to_remove:
198+
remove_version = str(v)
199+
log(2, 'Removing old backup: {version}', version=remove_version)
200+
remove_tree(os.path.join(bpath, remove_version, '')) # ensure trailing separator
198201
return

0 commit comments

Comments
 (0)