InputStream Helper 项目教程

InputStream Helper 项目教程

script.module.inputstreamhelperA simple Kodi module that makes life easier for add-on developers relying on InputStream based add-ons and DRM playback.项目地址:https://gitcode.com/gh_mirrors/sc/script.module.inputstreamhelper

1. 项目的目录结构及介绍

InputStream Helper 是一个用于 Kodi 的模块,旨在简化依赖 InputStream 和 DRM 播放的插件开发。以下是项目的目录结构及其介绍:

script.module.inputstreamhelper/
├── github/workflows/
├── lib/
│   └── resources/
│       └── tests/
├── .gitattributes
├── .gitignore
├── .pylintrc
├── LICENSE.txt
├── Makefile
├── README.md
├── addon.xml
├── codecov.yml
├── default.py
├── requirements.txt
├── setup.py
└── tox.ini
  • github/workflows/: 包含 GitHub Actions 的工作流配置文件。
  • lib/resources/tests/: 包含项目的测试文件。
  • .gitattributes: 用于设置 Git 属性。
  • .gitignore: 用于指定 Git 忽略的文件和目录。
  • .pylintrc: Pylint 的配置文件。
  • LICENSE.txt: 项目的许可证文件。
  • Makefile: 用于构建和管理的 Makefile。
  • README.md: 项目的说明文档。
  • addon.xml: Kodi 插件的配置文件。
  • codecov.yml: Codecov 的配置文件。
  • default.py: 项目的启动文件。
  • requirements.txt: 项目的依赖文件。
  • setup.py: 用于安装项目的脚本。
  • tox.ini: Tox 的配置文件。

2. 项目的启动文件介绍

项目的启动文件是 default.py。这个文件负责初始化和运行 InputStream Helper 模块。以下是 default.py 的部分代码示例:

from __future__ import absolute_import, division, unicode_literals
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/manifest.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"""
    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.license_type', 'com.widevine.alpha')
            play_item.setProperty('inputstream.adaptive.license_key', LICENSE_URL)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem=play_item)

3. 项目的配置文件介绍

项目的配置文件主要包括 addon.xmldefault.py

addon.xml

addon.xml 是 Kodi 插件的配置文件,定义了插件的元数据和依赖项。以下是 addon.xml 的部分内容示例:

<addon id="script.module.inputstreamhelper"
       name="InputStream Helper"
       version="0.6.1"
       provider-name="emilsvennesson">
    <requires>
        <import addon="xbmc.python" version="2.25.0"/>
    </requires>
    <extension point="xbmc.python.module" library="lib/"/>
    <extension point="xbmc.addon.metadata">
        <platform>all</

script.module.inputstreamhelperA simple Kodi module that makes life easier for add-on developers relying on InputStream based add-ons and DRM playback.项目地址:https://gitcode.com/gh_mirrors/sc/script.module.inputstreamhelper

  • 13
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

华朔珍Elena

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值