addon: wire play action + remote-control via Kodi JSON-RPC

main.py now handles the standard Kodi plugin-URL routing:

  plugin://plugin.video.torttube/?action=play&id=<yt-id>
  plugin://plugin.video.torttube/?action=play&url=<full-url>

Either form calls the sidecar resolve op, picks a stream URL from the
response (rustypipe video_stream preferred, yt-dlp combined fallback),
and hands it to Kodi via xbmcplugin.setResolvedUrl.

URL parser accepts watch?v=, youtu.be/, /shorts/, /embed/, /live/, and
bare 11-char IDs. setResolvedUrl flags inputstream.adaptive for .mpd
and .m3u8 manifests so DASH/HLS streams play with the right demuxer.

This makes 'share to TV' work over Kodi's existing JSON-RPC API on
:8080 — Player.Open with a plugin URL is all the remote client needs.
No new server, no app — Kore / Yatse / curl / HA all already work.

docs/remote-control.md captures the curl recipe + Android share-target
plan for the eventual companion app.
This commit is contained in:
Sulkta 2026-05-23 08:37:57 -07:00
parent 17871cfc00
commit 6e22873f8f
3 changed files with 261 additions and 7 deletions

View file

@ -27,9 +27,12 @@
## M3 — Kodi addon plays one video
- [ ] `addon.xml` + `main.py` register as video plugin
- [ ] hardcoded list of 3 test videos
- [ ] select → sidecar `resolve` → stream URL → Kodi player
- [ ] verified end-to-end on LibreELEC RPi at `kodi-host`
- [x] `main.py` handles `plugin://plugin.video.torttube/?action=play&id=<id>` and
`?url=<full-url>` — wired so JSON-RPC `Player.Open` from any LAN client
(phone, HA, curl) triggers resolve + play. See docs/remote-control.md.
- [ ] cross-compile sidecar for aarch64, drop into `bin/` of addon dir
- [ ] install + smoke on LibreELEC RPi at `kodi-host`
- [ ] (later) hardcoded list of 3 test videos for in-Kodi navigation
## M4 — search + channel browse