emre1393 / xtreamui-things

the things related with xtream-ui
GNU General Public License v3.0
38 stars 70 forks source link

start/stop via api #4

Closed bombolini closed 3 years ago

bombolini commented 3 years ago

Hello Emre, Could you please let us know how to integrate stream.php or api.php to start/stop a channel via command line? How to stop ch_id = 1 , which its server_id is 1: http://ip:port/api.php?action=stream&sub=stop&stream_id=1&server_id=1 This works only on Chrome/mozilla etc but not in terminal Can't get return when I send request via curl on a remote server.

Thank you Bombolini

emre1393 commented 3 years ago

idk, if you look into admin/api.php, you can see this,

if (in_array($rSub, Array("start", "stop"))) {
    echo APIRequest(Array("action" => "stream", "sub" => $rSub, "stream_ids" => Array($rStreamID), "servers" => Array($rServerID)));exit;

it uses 2 arrays with 2 "get" arguments, "stream_ids" and "servers" "stream_ids" => Array($rStreamID), "servers" => Array($rServerID) it may work like this, but i just don't know how to use those array things in curl command. curl -v "http://127.0.0.1:25461/api.php?action=stream&sub=start&stream_ids[]=1&servers[]=1"