Skip to content

firsttris/plugin.video.sendtokodi

Repository files navigation

SendToKodi (Kodi Add-on)

SendToKodi Banner

Build Coverage Kodi 19+ Chrome Extension Chrome Users Firefox Add-on Firefox Users

Send video or audio links from your browser or phone directly to Kodi. SendToKodi resolves supported websites to playable streams using yt-dlp.

✨ Features

  • 🎬 Stream links from supported websites directly in Kodi
  • 🌐 Works with browser extensions and mobile share flows
  • πŸ“‹ Playlist support via .m3u
  • πŸ”§ JSON-RPC and plugin integration support
  • πŸ’Ύ Optional auto-download before playback

πŸš€ Quick Start

  1. Install the SendToKodi Kodi add-on (steps below).
  2. Install one of the companion apps/extensions.
  3. Share or send a video URL to Kodi and start playback.

πŸ“¦ Install in Kodi

This add-on is not in the official Kodi add-on repository. For automatic updates, first add the SendToKodi repo:

  1. Download repository ZIP for Kodi 19+:
  2. In Kodi, go to Add-ons β†’ Install from zip file and install the ZIP.
  3. Then go to Add-ons β†’ Install from repository and install plugin.video.sendtokodi.

Reference: Kodi Add-on Manager

βœ… Requirements

  • Kodi 19+
  • script.module.inputstreamhelper (required for adaptive playback checks)
  • script.module.requests

Dependencies are installed automatically by Kodi when installing the add-on.

πŸ“± Companion Apps

Browser extensions

Extension source & issues: firsttris/chrome.sendtokodi

Mobile

βš™οΈ Settings

Settings Details (click to expand)

Open in Kodi via:

Add-ons β†’ My add-ons β†’ Video add-ons β†’ SendToKodi β†’ Configure

General

  • Enable legacy Python embed workarounds (advanced)
    Compatibility toggle for older/edge Python embedding behavior. Keep disabled unless you are troubleshooting runtime issues.
  • Auto-download resolved media before playback
    Downloads media to disk first instead of immediate streaming playback.
  • Media download path
    Folder used for auto-downloaded files. Default: special://profile/addon_data/plugin.video.sendtokodi/downloads

JavaScript Runtime

  • JavaScript runtime mode (auto|deno|quickjs)
    Select how JavaScript extraction/runtime tasks are handled:
    • auto: prefer best available runtime automatically
    • deno: force Deno
    • quickjs: force QuickJS
    • disabled: disable JavaScript runtime usage
  • QuickJS binary path
    Path to your QuickJS executable if you use QuickJS mode.
  • Auto-update Deno JavaScript runtime
    Automatically keeps the managed Deno runtime current.
  • Installed Deno version
    Read-only display of currently installed Deno.
  • Manage Deno version / Update Deno now
    Manual version selection and immediate update actions.
  • Deno version override (advanced)
    Pin/override Deno version manually (for advanced troubleshooting).

yt-dlp

  • Auto-update yt-dlp
    Keeps yt-dlp updated automatically (recommended).
  • Installed yt-dlp version
    Read-only display of installed yt-dlp.
  • Manage yt-dlp version / Update yt-dlp now
    Manually select a version or trigger an immediate update.
  • yt-dlp version override (advanced)
    Pin/override yt-dlp version manually.

Adaptive

  • Check if my kodi supports adaptive streaming
    Runs InputStream Adaptive capability check.
  • Use original manifest (experimental)
    Uses the source manifest path instead of generated alternatives.
  • Use DASH manifest builder (kodi 19+ only) (experimental)
    Enables internal DASH MPD builder for compatible playback flows.
  • DASH MPD server idle timeout (seconds)
    Refresh interval for the generated DASH manifest: after this many idle seconds, the next manifest request triggers a regeneration.
  • Ask which stream to play
    Prompts for stream selection when multiple variants are available.
  • Audio-only HLS: disable Opus for native m3u streams
    Improves compatibility for some native audio-only HLS playback cases.
  • Maximum resolution
    Caps playback stream width (or set Adaptive for automatic quality).

πŸ”Œ Integration

Developer Integration Examples (click to expand)

Example JSON-RPC request

{
  "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
}

Example JSON-RPC request with yt-dlp authentication

{
  "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.

Call SendToKodi from another Kodi plugin

# Preferred (explicit query param, URL-encoded):
xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.sendtokodi/?url=<urlencoded_stream_or_playlist_url>',return)")

# Legacy format (still supported):
xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.sendtokodi/?<stream_or_playlist_url>',return)")

Add item to Kodi queue

# Adds a playable item to Kodi's video playlist without starting playback immediately.
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.sendtokodi/?action=queue&url=<urlencoded_stream_url>&title=<urlencoded_title>)")

Test with Postman

  • Create a new HTTP POST request.
  • Use your Kodi endpoint, e.g. http://kodi:kodi@192.168.0.138:8080/jsonrpc.
  • Set body type to raw application/json.
  • Paste one of the JSON-RPC examples and send.

Note: in plugin URLs, query values must be URL-encoded (for example url=... and optional title=...).

πŸ’» Development

Development Setup (click to expand)

Run unit tests locally (recommended: inside a virtual environment):

  1. Install venv support (Ubuntu/Debian):
sudo apt install python3-venv
  1. Create a virtual environment in the project root:
python3 -m venv .venv
  1. Activate it (choose your shell):
  • fish:

    source .venv/bin/activate.fish
  • bash/zsh:

    source .venv/bin/activate
  1. Install test dependencies and run tests:
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pytest

Coverage reports are generated automatically:

  • Console report with missing lines
  • coverage.xml for CI integrations
  • htmlcov/index.html as a human-readable report

Local add-on installation for development

  1. Symlink (recommended)
# 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.sendtokodi

Restart Kodi (or disable/enable the add-on) after changes.

  1. Install local ZIP
zip -r plugin.video.sendtokodi-local.zip . -x "*.git*" "__pycache__/*" ".pytest_cache/*"

Then install via Add-ons β†’ Install from zip file.

🧰 Troubleshooting

  • Stream does not play: verify the URL works with yt-dlp and confirm the site is supported.
  • Adaptive playback issues: run Check if my Kodi supports adaptive streaming in Settings β†’ Adaptive.
  • Runtime/extractor issues: update Deno and yt-dlp from Settings (Update ... now actions).
  • QuickJS mode does not work: check that QuickJS binary path points to an existing executable.

Useful checks outside Kodi:

# Verify a URL can be resolved/playlisted by yt-dlp
yt-dlp --simulate "<url>"

# Show final direct media URL selected by yt-dlp
yt-dlp -g "<url>"

🀝 Contributing

Contributions are welcome. Please open an issue or submit a pull request.

License

This project is licensed under MIT. See LICENSE.md.

Packages

 
 
 

Contributors

Languages