Need to kill a stream

  • Hi all,

    I have LE 8 and TvH and under certain conditions I want to kill a live TV stream (ie: if a TV channel is streaming). So I can write the script I need to know what to check for and if found what process to kill. Can anyone point me in the right direction?

    TIA

    Greg

  • You can probably discover that something is playing via the JSON API but I don't think there's a method to distinguish whether it's playing a TVH stream or some other stream or something from the Library. You'd be better off asking that Q in Kodi forums.

  • To get what is played:

    Code
    curl -s -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "id": "VideoGetItem", "method": "Player.GetItem", "params": { "properties": ["tvshowid","file","uniqueid"], "playerid": 1}}' http://127.0.0.1:8080/jsonrpc

    and to stop it:

    Code
    curl -s -H 'Content-Type: application/json' -d '{ "id": 1, "jsonrpc": "2.0", "method": "Player.Stop", "params": {"playerid": 1}}' http://127.0.0.1:8080/jsonrpc {"id":1,"jsonrpc":"2.0","result":"OK"}