:tv: 在 Kodi 上使用 yt-dlp 播放各种流媒体网站
Send video or audio links from your browser or phone directly to Kodi. SendToKodi resolves supported websites to playable streams using yt-dlp.
.m3uThis add-on is not in the official Kodi add-on repository. For automatic updates, first add the SendToKodi repo:
plugin.video.sendtokodi.Reference: Kodi Add-on Manager
script.module.inputstreamhelper (required for adaptive playback checks)script.module.requestsDependencies are installed automatically by Kodi when installing the add-on.
Extension source & issues: firsttris/chrome.sendtokodi
Settings Details (click to expand)
Open in Kodi via:
Add-ons → My add-ons → Video add-ons → SendToKodi → Configure
special://profile/addon_data/plugin.video.sendtokodi/downloadsauto: prefer best available runtime automaticallydeno: force Denoquickjs: force QuickJSdisabled: disable JavaScript runtime usageSupported sites: yt-dlp supported websites
Call from playlists: playlist-example.m3u
Send URLs via JSON-RPC: Example JSON-RPC request
Call from another Kodi plugin: Plugin call example
Add item to Kodi queue: Queue integration example
Developer Integration Examples (click to expand)
{
"jsonrpc": "2.0",
"method": "Player.Open",
"params": {
"item": {
"file": "plugin://plugin.video.sendtokodi/?url=https%3A%2F%2Fsoundcloud.com%2Fspinnin-deep%2Fsam-feldt-show-me-love-edxs-indian-summer-remix-available-june-1"
}
},
"id": 1
}{
"jsonrpc": "2.0",
"method": "Player.Open",
"params": {
"item": {
"file": "plugin://plugin.video.sendtokodi/?url=https%3A%2F%2Fvk.com%2Fvideo-124136901_456239025&yt-dlp-options=%7B%22username%22%3A%22user%40email.com%22%2C%22password%22%3A%22password%20with%20spaces%22%7D"
}
},
"id": 1
}yt-dlp-options is passed directly to yt-dlp as a JSON object, so you can provide any supported yt-dlp options.
For backward compatibility, the legacy ydlOpts option key is still supported.
# Preferred (explicit query param, URL-encoded):
xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.sendtokodi/?url=',return)")
# Legacy format (still supported):
xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.sendtokodi/?',return)")# Adds a playable item to Kodi's video playlist without starting playback immediately.
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.sendtokodi/?action=queue&url=&title=)")POST request.http://kodi:[email protected]:8080/jsonrpc.application/json.Note: in plugin URLs, query values must be URL-encoded (for example url=... and optional title=...).
Development Setup (click to expand)
Run unit tests locally (recommended: inside a virtual environment):
sudo apt install python3-venvpython3 -m venv .venvfish:
source .venv/bin/activate.fishbash/zsh:
source .venv/bin/activatepython -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pytestCoverage reports are generated automatically:
coverage.xml for CI integrationshtmlcov/index.html as a human-readable report# Standard Kodi install
rm -rf ~/.kodi/addons/plugin.video.sendtokodi
ln -s /home/tristan/Projects/plugin.video.sendtokodi ~/.kodi/addons/plugin.video.sendtokodi
# Flatpak Kodi install
rm -rf /home/tristan/.var/app/tv.kodi.Kodi/data/addons/plugin.video.sendtokodi
ln -s /home/tristan/Projects/plugin.video.sendtokodi /home/tristan/.var/app/tv.kodi.Kodi/data/addons/plugin.video.sendtokodiRestart Kodi (or disable/enable the add-on) after changes.
zip -r plugin.video.sendtokodi-local.zip . -x "*.git*" "__pycache__/*" ".pytest_cache/*"Then install via Add-ons → Install from zip file.
Useful checks outside Kodi:
# Verify a URL can be resolved/playlisted by yt-dlp
yt-dlp --simulate ""
# Show final direct media URL selected by yt-dlp
yt-dlp -g ""Contributions are welcome. Please open an issue or submit a pull request.
This project is licensed under MIT. See LICENSE.md.
暂无开放 Issues,或尚未同步最近议题。