Create xjtv.js

This commit is contained in:
wcb1969
2025-04-26 10:34:55 +08:00
committed by GitHub
parent 7c7b5bb22c
commit 369a6d5f07

37
xjtv.js Normal file
View File

@@ -0,0 +1,37 @@
function main(item) {
const id = item.id || 'xjws';
const n = {
'xjws': 1, // 新疆卫视
'xjwyzh': 3, // 新疆维语综合
'xjhyzh': 4, // 新疆哈语综合
'xjzy': 16, // 新疆综艺
'xjwyys': 17, // 新疆维语影视
'xjjjsh': 18, // 新疆经济生活
'xjhyzy': 19, // 新疆哈语综艺
'xjwyjjsh': 20, // 新疆维语经济生活
'xjtyjk': 21, // 新疆体育健康
'xjxxfw': 22, // 新疆信息服务
'xjse': 23 // 新疆少儿频道
};
const t = Math.round(Date.now());
const sign = ku9.md5(`@#@$AXdm123%)(ds${t}api/TVLiveV100/TVChannelList`);
const url = `https://slstapi.xjtvs.com.cn/api/TVLiveV100/TVChannelList?type=1&stamp=${t}&sign=${sign}`;
const res = ku9.request(url);
if (res.code === 200) {
const data = JSON.parse(res.body).data;
let playurl = '';
for (const v of data) {
if (n[id] === v.Id) {
playurl = v.PlayStreamUrl;
break;
}
}
if (playurl) {
return { url: playurl };
} else {
return { error: "URL Error..." };
}
} else {
return { error: "获取数据出错..." };
}
}