Nice api : API for your applications ( Method GET ,JSON )
Function login - /login?login=user&pass=password
Request : http://www.example.com:4002/api/json/login?login=alex&pass=1234
Response ok:
{
"sid":"50f91f0739c84b58ecb6a5c7d2",
"sid_name":"MW_SSID",
"account":{"login":"alex","packet_name":"Nice","packet_id":"1","packet_expire":"1521676800"},
"services":0,
"settings":0,
"geo":0,
"messages":0,
"servertime":1517586814
}
Response err:
{
"error":{"message":"Access denied","code":3},
"servertime":1517577480
}
Function channel_list - /channel_list
Request : http://www.example.com:4002/api/json/channel_list
Response ok:
{
"groups":[
{
"id":"1",
"name":"SPORT",
"color":"Silver",
"channels":[
{"id":1,"name":"1 tv","is_video":1},
{"id":2,"name":"2 tv","is_video":1},
{"id":3,"name":"atv","is_video":1},
{"id":4,"name":"btv","is_video":1}
]
},
{
"id":"2",
"name":"MOVIE",
"color":"Silver",
"channels":[
{"id":5,"name":"voice","is_video":1},
{"id":6,"name":"5 tv","is_video":1}
]
}
],
"servertime":1517589200
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587205
}
Function get_url - ts - /get_url?cid=channel id
Request : http://www.example.com:4002/api/json/get_url?cid=1
Response ok:
{
"url":"697677743f30317678667375777a336d6b796933663738317570306c72787a756668a",
"messages":0,
"servertime":1517578306
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587183
}
Function get_url - hls - /get_urlh?cid=channel id
Request : http://www.example.com:4002/api/json/get_urlh?cid=1
Response ok:
{
"url":"697677743f30317678667375777a336d6b796933663738317570306c72787a756668a",
"messages":0,
"servertime":1517578306
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587183
}
Function epg_next - now and next - /epg_next?cid=channel id
Request : http://www.example.com:4002/api/json/epg_next?cid=1
Response ok:
{
"epg":[
{"ut_start":"1517584200","progname":"example epg text","t_start":"15:10"},
{"ut_start":"1517589300","progname":"example epg text","t_start":"16:35"}
],
"messages":0,
"servertime":1517586897
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587163
}
Function epg - all day - /epg?cid=channel id
Request : http://www.example.com:4002/api/json/epg?cid=1
Response ok:
{
"epg":[
{"ut_start":"1517584200","progname":"example epg text","t_start":"15:10"},
{"ut_start":"1517589300","progname":"example epg text","t_start":"16:35"},
{"ut_start":"1517592600","progname":"example epg text","t_start":"17:30"},
{"ut_start":"1517596500","progname":"example epg text","t_start":"18:35"},
{"ut_start":"1517610600","progname":"example epg text","t_start":"22:30"}
],
"messages":0,
"servertime":1517586922
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587141
}
Function categories_list - /categories_list
Request : http://www.example.com:4002/api/json/categories_list
Response ok:
{
"categories":[
{"id":"1","name":"SPORT"},
{"id":"2","name":"MOVIE"},
{"id":"3","name":"vod"},
{"id":"4","name":"series"}
],
"messages":0,
"servertime":1517586922
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587141
}
Function icons_list - /icons_list
Request : http://www.example.com:4002/api/json/icons_list
Response ok:
{
"icons":[
{"ch_id":1,"source":"https://example.com/zdf.png"},
{"ch_id":2,"source":""},
{"ch_id":15,"source":""},
{"ch_id":12,"source":"https://example.com/tvp.png"}
],
"messages":0,
"servertime":1517586922
}
Response err:
{
"error":{"message":"Login incorrect","code":4},
"servertime":1517587141
}
if you do not use cookies - add MW_SSID = cookies
Request : http://www.example.com:4002/api/json/login?login=alex&pass=1234
Request : http://www.example.com:4002/api/json/channel_list?MW_SSID=50f91f0739c84b58ecb6a5c7d2
Request : http://www.example.com:4002/api/json/get_url?cid=1&MW_SSID=50f91f0739c84b58ecb6a5c7d2
Request : http://www.example.com:4002/api/json/get_urlh?cid=1&MW_SSID=50f91f0739c84b58ecb6a5c7d2
Request : http://www.example.com:4002/api/json/epg?cid=1&MW_SSID=50f91f0739c84b58ecb6a5c7d2
Request : http://www.example.com:4002/api/json/epg_next?cid=1&MW_SSID=50f91f0739c84b58ecb6a5c7d2
Decrypt url js - > of course we can write it optimally :)
.... var answer.url = "697677743f30317678667375777a336d6b796933663738317570306c72787a756668a"
var src = answer.url;
var srcnl = "";
var ivv = 0;
var ivn = 0;
for(var i = 0; i < src.length ; i+=2){
if (ivv > 4){ivv = 0;}
ivv++;
hexNumber = src.substr(i,2);
ivn = parseInt(hexNumber,16)-ivv;
srcnl = srcnl + String.fromCharCode(ivn);
}
var url = srcnl