189 lines
15 KiB
JavaScript
189 lines
15 KiB
JavaScript
|
var rule = {
|
|||
|
title: '虎牙直播',
|
|||
|
host: 'https://www.huya.com',
|
|||
|
homeUrl: '/cache.php?m=LiveList&do=getLiveListByPage&gameId=2168&tagAll=0&page=1',//用于"分类获取"和"推荐获取"
|
|||
|
url: '/cache.php?m=LiveList&do=getLiveListByPage&gameId=fyfilter&tagAll=0&page=fypage',
|
|||
|
class_name: '娱乐&网游&单机&手游',
|
|||
|
class_url: '8&1&2&3',
|
|||
|
// detailUrl:'https://m.huya.com/fyid',//二级详情拼接链接(json格式用)
|
|||
|
detailUrl: 'http://live.yj1211.work/api/live/getRoomInfo?uid=&platform=huya&roomId=fyid',//二级详情拼接链接(json格式用)
|
|||
|
filterable: 1,
|
|||
|
filter_url: '{{fl.cateId}}',
|
|||
|
filter_def: {
|
|||
|
8: {cateId: '2135'},
|
|||
|
1: {cateId: '1'},
|
|||
|
2: {cateId: '1732'},
|
|||
|
3: {cateId: '2336'}
|
|||
|
},
|
|||
|
filter: 'H4sIAAAAAAAAA51bWW9bR5b+K4afZoAMQN6NZL+5Y7i7k04cJ5PBLOgHY+JpDJK2B86kMY1GAFIURcoUKdGiRNEkJVGrtVMSJXEnML+FdZen/IU5xauq+opOHnoAPti6l7Wc5TvfWfjXh9GHv/q3vz789sVfHv7q4b8//+8Xv/vm4UcPXz7/0wv6P8steJd9+v+fn3/3w4vpiy/pz37+MqjN+6myV9viD+lP0Yc/fhQ+/Pgr4/5vcceQf/WOxv7tGy914vXG948t+fC7V99NeqWgeTvp5tkgd//ctuK2fMWtbHtry2y/5PUOxPOEGZPPJ/0iW6jdP4lFYgl1nie/fXz/dwf/HiQX3NyGOL6ptvLmFr2t68lg279o3z82E6Z8/PjpPz4SN1T7s3pr0smzreKkU2T5LNs9uX9FiSA4K7PMcNJZ99aWhITU9xsHLJPXH0YMbdOouIUSys7BpLPIakMh0XhidrfeYlDvmOK5E1XXDCrnQWpV3D8CVykN/fGKu971c0K7Zs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ZE5XVa/2litg8cKtC9EmolDb9Q5SQeXMvZxT6YwTASSiZAFTBcnwgUnx2vFVNzh+R3RHxlPIl4kicR3vb7rnIp45DoDHDO6SNFWqASKYlugpJnmLMm0y4xgVUwTNfqPtN25pORnToISSug3OytwpZabioCiQPWgx1bSjPyNwt9Z1VwuQvNgJoNkNypHPWWtdlcRNZJeIrhzWbu7cnox3DlbW9o4JCFiuwXZkUHOwGNFtBPV5b3CtuaGdgLhGTC/ILpER+jc14iBx9Q5E7ikxCbNaSykJehXNymzWQzaA1esUW0
|
|||
|
searchUrl: 'https://search.cdn.huya.com/?m=Search&do=getSearchContent&q=**&uid=0&v=4&typ=-5&livestate=0&rows=40&start=0',
|
|||
|
searchable: 2,
|
|||
|
quickSearch: 0,
|
|||
|
headers: {
|
|||
|
'User-Agent': 'MOBILE_UA'
|
|||
|
},
|
|||
|
timeout: 5000,
|
|||
|
limit: 8,
|
|||
|
play_parse: true,
|
|||
|
lazy: '',
|
|||
|
lazy: `js:
|
|||
|
if (/m\\.huya/.test(input)) {
|
|||
|
rule.sniffer = 0
|
|||
|
}
|
|||
|
`,
|
|||
|
推荐: `js:
|
|||
|
let d = [];
|
|||
|
let jo = JSON.parse(request(input)).data.datas;
|
|||
|
jo.forEach(it => {
|
|||
|
d.push({
|
|||
|
url: it.profileRoom,
|
|||
|
title: it.introduction,
|
|||
|
img: it.screenshot,
|
|||
|
desc: '👁' + it.totalCount + ' 🆙' + it.nick,
|
|||
|
})
|
|||
|
});
|
|||
|
setResult(d);
|
|||
|
`,
|
|||
|
一级: `js:
|
|||
|
let d = [];
|
|||
|
let jo = JSON.parse(request(input)).data.datas;
|
|||
|
jo.forEach(it => {
|
|||
|
d.push({
|
|||
|
url: it.profileRoom,
|
|||
|
title: it.introduction,
|
|||
|
img: it.screenshot,
|
|||
|
desc: '👁' + it.totalCount + ' 🆙' + it.nick,
|
|||
|
})
|
|||
|
});
|
|||
|
setResult(d);
|
|||
|
`,
|
|||
|
// 二级:'*',
|
|||
|
二级: `js:
|
|||
|
try {
|
|||
|
if (typeof play_url === "undefined") {
|
|||
|
var play_url = ""
|
|||
|
}
|
|||
|
var jo = JSON.parse(request(input)).data;
|
|||
|
VOD = {
|
|||
|
vod_id: jo.roomId,
|
|||
|
vod_name: jo.roomName,
|
|||
|
vod_pic: jo.roomPic,
|
|||
|
type_name: "虎牙." + jo.categoryName,
|
|||
|
vod_director: '🆙 ' + jo.ownerName,
|
|||
|
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; //多线路
|
|||
|
if (Object.keys(episodes).length !== 0) {
|
|||
|
let playFrom = [];
|
|||
|
let playList = [];
|
|||
|
let kplayList = [];
|
|||
|
Object.keys(episodes).forEach(function(key) {
|
|||
|
playFrom.append(key);
|
|||
|
kplayList = episodes[key].map(function(it) {
|
|||
|
let title = it.qualityName;
|
|||
|
let playUrl = it.playUrl
|
|||
|
return title + "$" + play_url + urlencode(playUrl)
|
|||
|
}).join("#")
|
|||
|
playList.append(kplayList);
|
|||
|
});
|
|||
|
let vod_play_from = playFrom.join("$$$");
|
|||
|
let vod_play_url = playList.join("$$$");
|
|||
|
VOD["vod_play_from"] = vod_play_from;
|
|||
|
VOD["vod_play_url"] = vod_play_url;
|
|||
|
} else {
|
|||
|
var d = [];
|
|||
|
episodes = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrl?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //单线路
|
|||
|
var name = {
|
|||
|
"OD": "原画",
|
|||
|
"FD": "流畅",
|
|||
|
"LD": "标清",
|
|||
|
"SD": "高清",
|
|||
|
"HD": "超清",
|
|||
|
"2K": "2K",
|
|||
|
"4K": "4K",
|
|||
|
"FHD": "全高清",
|
|||
|
"XLD": "极速",
|
|||
|
"SQ": "普通音质",
|
|||
|
"HQ": "高音质"
|
|||
|
};
|
|||
|
Object.keys(episodes).forEach(function(key) {
|
|||
|
if (!/ayyuid|to/.test(key)) {
|
|||
|
d.push({
|
|||
|
title: name[key],
|
|||
|
url: episodes[key]
|
|||
|
})
|
|||
|
}
|
|||
|
});
|
|||
|
d.push(
|
|||
|
{
|
|||
|
title: "虎牙解析",
|
|||
|
url: "http://cfss.cc/cdn/hy/" + jo.roomId + ".flv"
|
|||
|
},
|
|||
|
{
|
|||
|
title: "解析1",
|
|||
|
url: "http://epg.112114.xyz/huya/" + jo.roomId
|
|||
|
},
|
|||
|
{
|
|||
|
title: "解析2",
|
|||
|
url: "https://www.aois.eu.org/live/huya/" + jo.roomId
|
|||
|
},
|
|||
|
{
|
|||
|
title: "解析3",
|
|||
|
url: "https://www.goodiptv.club/huya/" + jo.roomId
|
|||
|
},
|
|||
|
// {
|
|||
|
// title: "解析4",
|
|||
|
// url: "http://maomao.kandiantv.cn/huya1.php?id=" + jo.roomId
|
|||
|
// },
|
|||
|
{
|
|||
|
title: "解析5",
|
|||
|
url: "http://43.138.170.29:35455/huya/" + jo.roomId
|
|||
|
},
|
|||
|
{
|
|||
|
title: "解析6",
|
|||
|
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_url"] = d.map(function(it) {
|
|||
|
return it.title + "$" + it.url
|
|||
|
}).join("#");
|
|||
|
setResult(d);
|
|||
|
}
|
|||
|
} catch (e) {
|
|||
|
log("获取二级详情页发生错误:" + e.message);
|
|||
|
}
|
|||
|
`,
|
|||
|
// 搜索:'json:response.3.docs;game_roomName;game_screenshot;game_nick;room_id',
|
|||
|
搜索: `js:
|
|||
|
var d = [];
|
|||
|
let jo = JSON.parse(request(input)).response[3].docs;
|
|||
|
jo.forEach(it => {
|
|||
|
d.push({
|
|||
|
url: it.room_id,
|
|||
|
title: it.game_roomName,
|
|||
|
img: it.game_screenshot,
|
|||
|
desc: '👁' + it.game_total_count + ' 🆙' + it.game_nick,
|
|||
|
})
|
|||
|
});
|
|||
|
setResult(d);
|
|||
|
`,
|
|||
|
|
|||
|
//是否启用辅助嗅探: 1,0
|
|||
|
sniffer: 1,
|
|||
|
// 辅助嗅探规则js写法
|
|||
|
isVideo: `js:
|
|||
|
log(input);
|
|||
|
if(/\\/huya/.test(input)) {
|
|||
|
input = true
|
|||
|
} else if(/\\.flv?|\\.m3u8?|\\.mp4?/.test(input)){
|
|||
|
input = true
|
|||
|
}else{
|
|||
|
input = false
|
|||
|
}
|
|||
|
`,
|
|||
|
}
|