Sorry for the thread necro, just got here from a web search.
The solution to your problem is to add one level of indirection, using a custom Python video plugin and the "plugin://" protocol that Kodi understands:
json:
{
"jsonrpc":"2.0",
"id":"1",
"method":"Player.Open",
"params": {
"item": {
"file": "plugin%3A%2F%2Fplugin.video.mycustomplugin%2F%3Furl%3Dhttps%253A%252F%252Ftest-videos.co.uk%252Fvids%252Fbigbuckbunny%252Fmp4%252Fh264%252F720%252FBig_Buck_Bunny_720_10s_30MB.mp4%26title%3DBig%2BBuck%2BBunny"
}
}
}
That is, don't supply the raw media file, but rather your own plugin URL with any parameters either in the path (separated by slashes), OR appended at the end in URL-parameter form (that is,
quote_plus
encoded, like "plugin://plugin.video.mycustomplugin/?param1=value1¶m2=value2&title=Big+Buck+Bunny").
Your plugin will be invoked and in its entry-point Python script you can read the URL parameters and do what you want, as long as you finish with a call to
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, myListItem)
to resolve this indirection and start playback. That
myListItem
argument is a xbmcgui.ListItem with the raw media URL as the path and all the metadata you want, such as title, year etc.
If you want Kodi to use custom HTTP headers when requesting the media file, you can use the pipe symbol format in the raw media URL (with the names of headers as plaintext and their respective values
quote_plus
encoded):
https://kodi.wiki/view/HTTP