Update 虎牙直播.js

This commit is contained in:
Hisoar Y 2024-02-24 16:01:59 +00:00
parent 641b7d19e3
commit 783ef54363

View File

@ -39,39 +39,36 @@ var rule = {
limit:8, limit:8,
play_parse:true, play_parse:true,
lazy:'', lazy:'',
lazy:`js:
if (/m\\.huya/.test(input)) {
rule.sniffer = 0
}
`,
推荐:`js: 推荐:`js:
let d = []; let d = [];
let jo = JSON.parse(request(input)).data.datas; let jo = JSON.parse(request(input)).data;
jo.forEach(it => { jo.forEach((it,idex) => {
let slist = jo[idex].list ;
slist.forEach(it => {
d.push({ d.push({
url: it.profileRoom, url: it.rid,
title: it.introduction, title: it.roomName,
img: it.screenshot, img: it.roomSrc,
desc: '👁' + it.totalCount + ' 🆙' + it.nick, desc: '👁' + it.hn + ' 🆙' + it.nickname,
}) })
}); });
});
setResult(d); setResult(d);
`, `,
一级:`js: 一级:`js:
let d = []; let d = [];
let jo = JSON.parse(request(input)).data.datas; let jo = JSON.parse(request(input)).data.list;
jo.forEach(it => { jo.forEach(it => {
d.push({ d.push({
url: it.profileRoom, url: it.rid,
title: it.introduction, title: it.roomName,
img: it.screenshot, img: it.roomSrc,
desc: '👁' + it.totalCount + ' 🆙' + it.nick, desc: '👁' + it.hn + ' 🆙' + it.nickname,
}) })
}); });
setResult(d); setResult(d);
`, `,
// 二级:'*', 二级:`js:
二级: `js:
try { try {
if (typeof play_url === "undefined") { if (typeof play_url === "undefined") {
var play_url = "" var play_url = ""
@ -81,9 +78,9 @@ var rule = {
vod_id: jo.roomId, vod_id: jo.roomId,
vod_name: jo.roomName, vod_name: jo.roomName,
vod_pic: jo.roomPic, vod_pic: jo.roomPic,
type_name: "虎牙." + jo.categoryName, type_name: "斗鱼." + jo.categoryName,
vod_director: '🆙 ' + jo.ownerName, vod_director: '🆙 ' + jo.ownerName,
vod_content: "🏷分区:虎牙" + "·" + jo.categoryName + " 🏷UP主" + jo.ownerName + " 🏷人气:" + jo.online + (jo.isLive === 1 ? " 🏷状态:正在直播" : "状态:未开播") vod_content: "🏷分区:斗鱼" + "·" + jo.categoryName + " 🏷UP主" + jo.ownerName + " 🏷人气:" + jo.online + (jo.isLive === 1 ? " 🏷状态:正在直播" : "状态:未开播")
}; };
let episodes = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrlMultiSource?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //多线路 let episodes = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrlMultiSource?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //多线路
if (Object.keys(episodes).length !== 0) { if (Object.keys(episodes).length !== 0) {
@ -128,17 +125,9 @@ var rule = {
} }
}); });
d.push( d.push(
{
title: "虎牙最新解析",
url: "https://live.metshop.top/huya/" + jo.roomId
},
{
title: "虎牙解析",
url: "http://cfss.cc/cdn/hy/" + jo.roomId + ".flv"
},
{ {
title: "解析1", title: "解析1",
url: "http://epg.112114.xyz/huya/" + jo.roomId url: "https://live.metshop.top/huya/" + jo.roomId
}, },
{ {
title: "解析2", title: "解析2",
@ -160,10 +149,6 @@ var rule = {
title: "解析6", title: "解析6",
url: "http://8.210.232.168/php/huya.php?id=" + jo.roomId url: "http://8.210.232.168/php/huya.php?id=" + jo.roomId
}, },
{
title: "原址嗅探",
url: "https://m.huya.com/" + jo.roomId
},
); );
VOD["vod_play_from"] = "播放源"; VOD["vod_play_from"] = "播放源";
VOD["vod_play_url"] = d.map(function(it) { VOD["vod_play_url"] = d.map(function(it) {
@ -175,16 +160,22 @@ var rule = {
log("获取二级详情页发生错误:" + e.message); log("获取二级详情页发生错误:" + e.message);
} }
`, `,
// 搜索:'json:response.3.docs;game_roomName;game_screenshot;game_nick;room_id', // 搜索:'json:data.list;roomName;roomSrc;nickname;roomId',
搜索: `js: 搜索: `js:
var d = []; var d = [];
let jo = JSON.parse(request(input)).response[3].docs; let rurls = input.split(';')[0].split('#');
let rurl = rurls[0];
let params = rurls.length > 1 ?rurls[1]:'';
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let postData = {body:params};
Object.assign(_fetch_params,postData);
let jo = JSON.parse(post(rurl,_fetch_params)).data.list;
jo.forEach(it => { jo.forEach(it => {
d.push({ d.push({
url: it.room_id, url: it.roomId,
title: it.game_roomName, title: it.roomName,
img: it.game_screenshot, img: it.roomSrc,
desc: '👁' + it.game_total_count + ' 🆙' + it.game_nick, desc: '👁' + it.hn + ' 🆙' + it.nickname,
}) })
}); });
setResult(d); setResult(d);