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

A simple Kodi module that makes life easier for add-on developers relying on InputStream based add-ons and DRM playback.

License

Notifications You must be signed in to change notification settings

emilsvennesson/script.module.inputstreamhelper

Repository files navigation

GitHub release CI Codecov status License: MIT Contributors

InputStream Helper

script.module.inputstreamhelper is a simple Kodi module that makes life easier for add-on developers relying on InputStream based add-ons and DRM playback.

Features

  • Displays informative dialogs if required InputStream components are unavailable
  • Checks if HLS is supported in inputstream.adaptive
  • Automatically installs Widevine CDM on supported platforms (optional)
    • Keeps Widevine CDM up-to-date with the latest version available (Kodi 18 and higher)
    • Checks for missing depending libraries by parsing the output from ldd (Linux)

Example

# -*- coding: utf-8 -*-
"""InputStream Helper Demo"""
import sys
import inputstreamhelper
import xbmc
import xbmcgui
import xbmcplugin
PROTOCOL = 'mpd'
DRM = 'com.widevine.alpha'
STREAM_URL = 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-dash-widevine.ism/.mpd'
MIME_TYPE = 'application/dash+xml'
LICENSE_URL = 'https://widevine-proxy.appspot.com/proxy'
KODI_VERSION_MAJOR = int(xbmc.getInfoLabel('System.BuildVersion').split('.')[0])
def run(addon_url):
 """Run InputStream Helper Demo"""
 # Play video
 if addon_url.endswith('/play'):
 is_helper = inputstreamhelper.Helper(PROTOCOL, drm=DRM)
 if is_helper.check_inputstream():
 play_item = xbmcgui.ListItem(path=STREAM_URL)
 play_item.setContentLookup(False)
 play_item.setMimeType(MIME_TYPE)
 if KODI_VERSION_MAJOR >= 19:
 play_item.setProperty('inputstream', is_helper.inputstream_addon)
 else:
 play_item.setProperty('inputstreamaddon', is_helper.inputstream_addon)
 play_item.setProperty('inputstream.adaptive.manifest_type', PROTOCOL)
 play_item.setProperty('inputstream.adaptive.license_type', DRM)
 play_item.setProperty('inputstream.adaptive.license_key', LICENSE_URL + '||R{SSM}|')
 xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, play_item)
 # Setup menu item
 else:
 xbmcplugin.setContent(int(sys.argv[1]), 'videos')
 list_item = xbmcgui.ListItem(label='InputStream Helper Demo')
 list_item.setInfo('video', {})
 list_item.setProperty('IsPlayable', 'true')
 url = addon_url + '/play'
 xbmcplugin.addDirectoryItem(int(sys.argv[1]), url, list_item)
 xbmcplugin.endOfDirectory(int(sys.argv[1]))
if __name__ == '__main__':
 run(sys.argv[0])

The Helper class takes two arguments: protocol (the media streaming protocol) and the optional argument 'drm'.

It is recommended to not add your InputStream add-on as a dependency in addon.xml. It can cause confusion with users not being able to install your add-on because the InputStream add-on is disabled. InputStream Helper addresses issues such as these and helps the user to install/enable required InputStream components.

Accepted protocol arguments:

  • mpd -- MPEG-DASH
  • ism -- Microsoft Smooth Streaming
  • hls -- HTTP Live Streaming from Apple
  • rtmp -- Real-Time Messaging Protocol

Accepted drm arguments:

  • widevine
  • com.widevine.alpha

Support

Please report any issues or bug reports on the GitHub Issues page.

License

This module is licensed under the The MIT License. Please see the 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)

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)

v0.7.0 (2024年09月24日)

  • Get rid of distutils dependency (@horstle, @emilsvennesson)
  • Option to get Widevine from lacros image (@horstle)
  • Remove support for Python 2 and pre-Matrix Kodi versions (@horstle)

v0.6.1 (2023年05月30日)

  • Performance improvements on Linux ARM (@horstle)
  • This will be the last release for Python 2 i.e. Kodi 18 (Leia) and below. The next release will require Python 3 and Kodi 19 (Matrix) or higher.

v0.6.0 (2023年05月03日)

  • Initial support for AARCH64 Linux (@horstle)
  • Initial support for AARCH64 Macs (@mediaminister)
  • New option to install a specific version on most platforms (@horstle)

v0.5.10 (2022年04月18日)

  • Fix automatic submission of release (@mediaminister)
  • Update German translation (@tweimer)
  • Fix update_frequency setting (@horstle)
  • Fix install_from (@horstle)
  • Improve/Fix Widevine extraction from Chrome OS images (@horstle)

v0.5.9 (2022年03月22日)

  • Update Croatian translation (@dsardelic, @muzena)
  • Replace deprecated LooseVersion (@mediaminister, @MarkusVolk)
  • Fix http_get decode error (@archtur)
  • Option to install Widevine from specified source (@horstle)

v0.5.8 (2021年09月09日)

  • Simplify Widevine CDM installation on ARM hardware (@horstle, @mediaminister)
  • Update Chrome OS ARM hardware id's (@mediaminister)
  • Update Japanese and Korean translations (@Thunderbird2086)

v0.5.7 (2021年07月02日)

  • Further improve Widevine CDM installation on ARM hardware (@horstle)

v0.5.6 (2021年06月24日)

  • Improve Widevine CDM installation on ARM hardware (@mediaminister)
  • Postpone Widevine CDM updates when user rejects (@horstle)

v0.5.5 (2021年06月02日)

  • Improve Widevine CDM installation on ARM hardware (@mediaminister)

v0.5.4 (2021年05月27日)

  • Fix Widevine CDM installation on ARM hardware (@mediaminister)

v0.5.3 (2021年05月10日)

  • Temporary fix for Widevine CDM installation on ARM hardware (@mediaminister)
  • Fix Widevine CDM installation on 32-bit Linux (@mediaminister)

v0.5.2 (2020年12月13日)

  • Update Chrome OS ARM hardware id's (@mediaminister)

v0.5.1 (2020年10月02日)

  • Fix incorrect ARM HWIDs: PHASER and PHASER360 (@dagwieers)
  • Added Hebrew translations (@haggaie)
  • Updated Dutch, Japanese and Korean translations (@michaelarnauts, @Thunderbird2086)

v0.5.0 (2020年06月25日)

  • Extract Widevine CDM directly from Chrome OS, minimizing disk space usage and eliminating the need for root access (@horstle)
  • Improve progress dialog while extracting Widevine CDM on ARM devices (@horstle, @mediaminister)
  • Support resuming interrupted downloads on unreliable internet connections (@horstle, @mediaminister)
  • Reshape InputStream Helper information dialog (@horstle, @dagwieers)
  • Updated Dutch, English, French, German, Greek, Hungarian, Romanian, Russian, Spanish and Swedish translations (@dagwieers, @horstle, @mediaminister, @tweimer, @Twilight0, @frodo19, @tmihai20, @vlmaksime, @roliverosc, @Sopor)

v0.4.7 (2020年05月03日)

  • Fix hardlink on Windows (@BarmonHammer)
  • Fix support for unicode chars in paths (@mediaminister)
  • Show remaining time during Widevine installation on ARM devices (@horstle)

v0.4.6 (2020年04月29日)

  • Compatibility fixes for Kodi 19 Matrix "pre-release" builds (@mediaminister)
  • Optimize Widevine CDM detection (@dagwieers)
  • Minor fixes for Widevine installation on ARM devices (@dagwieers @mediaminister @horstle)

v0.4.5 (2020年04月07日)

  • Added Spanish and Romanian translations (@roliverosc, @tmihai20)
  • Added support for Kodi 19 Matrix "pre-release" builds (@mediaminister)
  • Fix Widevine backups when using an external drive (@horstle)
  • Various fixes for Widevine installation on ARM devices (@horstle)

v0.4.4 (2020年03月01日)

  • Added option to restore a previously installed Widevine version (@horstle)
  • Improve progress bar when extracting Widevine on ARM devices (@dagwieers)
  • Improve Widevine library version detection (@dagwieers, @mediaminister)
  • Improve InputStream Helper information (@dagwieers, @mediaminister)
  • Increase download reliability for Chrome OS on ARM devices (@horstle, @RolfWojtech)
  • Added Japanese, Korean, Croatian and Hungarian translations (@Thunderbird2086, @arvvoid, @frodo19)
  • Updated existing translations (@dnicolaas, @Sopor, @tweimer, @horstle, @mediaminister)
  • Various small bugfixes for Widevine installation on ARM devices (@dagwieers, @mediaminister, @Twilight0, @janhicken)

v0.4.3 (2019年09月25日)

  • French translation (@brunoduc)
  • Updated translations (@vlmaksime, @dagwieers, @pinoelefante, @horstle, @Twilight0, @emilsvennesson)
  • Ensure Kodi 19 compatibility (@mediaminister)
  • Configurable temporary download directory for devices with limited space (@horstle)
  • Configurable Widevine CDM update frequency (@horstle)
  • Fix add-on settings crashes when InputStream Adaptive is missing (@mediaminister)
  • Improve unicode character support (@mediaminister)

v0.4.2 (2019年09月03日)

  • Move release history to readme file (@mediaminister)
  • Clean up coverage/codecov config (@dagwieers)
  • Add InputStream Helper Information to settings page (@horstle, @dagwieers)
  • Make sure addon.xml meets all requirements (@mediaminister)
  • Simplify add-on entry point to speed up loading time (@mediaminister)
  • Unicode fix for os.walk (@mediaminister)
  • Revert "Fix ARM processing in unittest locally" (@mediaminister)
  • Fix unresponsive Kodi when opening add-on information pane (@dagwieers, @mediaminister)
  • Add-on structure improvements (@dagwieers)

v0.4.1 (2019年09月01日)

  • Follow kodi-addon-checker recommended code changes (@mediaminister)
  • Implement api using runscript (@mediaminister)
  • Fix ARM processing in unittest locally (@dagwieers)
  • Add more project information (@dagwieers)
  • More coverage improvements (@dagwieers)

v0.4.0 (2019年09月01日)

  • Use local url variable (@mediaminister)
  • Directly use Kodi CDM directory (@mediaminister)
  • Implement settings menu and API (@dagwieers)
  • Add integration tests (@dagwieers)
  • Add a progress dialog for extraction on ARM (@dagwieers)
  • Fix crash when using platform.system() (@dagwieers)
  • Fix a python error (@mediaminister)
  • Remove legacy Widevine CDM support (@dagwieers)
  • Replace requests/urllib3 with urllib/urllib2 (@dagwieers)
  • Various unicode fixes (@mediaminister)
  • Add proxy support (@dagwieers)
  • Add setting to disable inputstreamhelper (@horstle, @JohnPlayerSpecial2018)
  • Check Widevine support before all checks (@vlmaksime)
  • Support 64-bit kernel with 32-bit userspace (@mrfixit2001)
  • Dutch translation (@mediaminister, @basrieter)
  • German translation (@flubshi)
  • Greek translation (@Twilight0)
  • Italian translation (@pinoelefante)
  • Russian translation (@vlmaksime)
  • Swedish translation (@emilsvennesson)

v0.3.5 (2019年08月15日)

  • Auto install inputstream.adaptive (@mediaminister)
  • Fix latest Widevine version detection (@dagwieers)
  • Check for Widevine updates on new release (@mediaminister)

v0.3.4 (2019年03月23日)

  • python2_3 compability (@mediaminister, @Rechi)
  • Option to disable inputstreamhelper in settings.xml
  • calculate disk space on the tmp folder (@dawez)
  • Support for Unicode paths in Windows (@WallyCZ)
  • Italian translation (@pinoelefante)
  • Dutch translation (@dnicolaas)
  • Greek translation (@Twilight0)
  • Russian translation (@vlmaksime)

v0.3.3 (2018年02月21日)

  • Load loop if it's a kernel module (@mkreisl)
  • Fix legacy Widevine CDM update detection
  • inputstream_addon is now a public variable
  • Notify user that ARM64 needs 32-bit userspace
  • Improve logging
  • Cosmetics

v0.3.2 (2018年01月30日)

  • Fix OSMC arm architecture detection
  • Fix ldd permissions error

v0.3.1 (2018年01月29日)

  • check_inputstream() return fix

v0.3.0 (2018年01月29日)

  • Bug fix: module left xbmcaddon class in memory
  • Keep Widevine CDM up-to-date with the latest version available (Kodi 18 and higher)
  • Check for missing depending libraries by parsing the output from ldd
  • Use older Widevine binaries on Kodi Krypton (fixes nss/nspr dependency issues)

v0.2.4 (2018年01月01日)

  • Fix ARM download on systems with sudo (OSMC etc)
  • Actually bump version in addon.xml, unlike v0.2.3...

v0.2.3 (2017年12月30日)

  • Make sure Kodi and Widevine CDM binary architecture matches
  • Minor wording changes/fixes

v0.2.2 (2017年12月05日)

  • Fixes for widevine download when using 64-bit Kodi (@gismo112, @asciidisco)

v0.2.1 (2017年10月15日)

  • Update German translation (@asciidisco)
  • Improve root permissions acquisition

v0.2.0 (2017年09月29日)

  • Automatic Widevine CDM download on ARM devices
  • Display Widevine EULA during installation procedure
  • German translation (thanks to asciidisco)
  • New, smaller and less ugly generic icon
  • Better exception handling
  • Code cleanup

v0.1.0 (2017年09月13日)

  • Initial release

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