代码拉取完成,页面将自动刷新
同步操作将从 Honrun/CatVodOpenJson 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import { Crypto, load, _ } from 'assets://js/lib/cat.js';
let key = 'douyu';
let host = 'http://live.yj1211.work';
let siteKey = '';
let siteType = 0;
const MOBILE_UA = 'Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36';
async function requestRaw(reqUrl, redirect) {
let resRaw = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': MOBILE_UA,
},
redirect: redirect,
});
return resRaw;
}
async function request(reqUrl) {
let resRaw = await requestRaw(reqUrl, 1)
return resRaw.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
}
async function home(filter) {
const classes = [
{ type_id: "热门游戏", type_name: "热门游戏" },
{ type_id: "主机游戏", type_name: "主机游戏" },
{ type_id: "原创IP", type_name: "原创IP" },
];
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
return cls;
}),
filters: filterObj,
});
}
async function homeVod() {
const data = JSON.parse(await request(host + '/api/live/getRecommendByPlatformArea?platform=douyu&size=20&area=热门游戏&page=1'));
let videos = _.map(data.data.list, (it) => {
return {
vod_id: it.roomId,
vod_name: it.roomName,
vod_pic: it.roomPic,
vod_remarks: it.ownerName,
}
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == 'undefined') pg = 1;
const data = JSON.parse(await request(host + '/api/live/getRecommendByPlatformArea?platform=douyu&size=20&area=' + tid + '&page=' + pg));
let videos = _.map(data.data, (it) => {
return {
vod_id: it.roomId,
vod_name: it.roomName,
vod_pic: it.roomPic,
vod_remarks: it.ownerName,
}
});
return JSON.stringify({
page: parseInt(pg),
pagecount: 9999,
limit: 90,
total: 999999,
list: videos,
});
}
async function detail(id) {
const data = JSON.parse(await request(host + '/api/live/getRoomInfo?platform=douyu&roomId=' + id));
const video = data.data;
let vod = {
vod_id: video.roomId,
vod_name: video.roomName,
vod_pic: video.roomPic,
vod_remarks: video.categoryName,
type_name: video.categoryName,
vod_director: video.ownerName,
vod_actor: '在线人数:' + video.online,
vod_content: "",
vod_year: "",
vod_area: "",
};
vod.vod_play_from = video.platForm;
vod.vod_play_url = '原画$' + id;
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const resp = await requestRaw('https://getplayurl.lmteam.repl.co/live?platform=douyu&rid=' + id, 0);
const headers = resp.headers;
let url = "";
if (headers.hasOwnProperty('location')) {
url = headers.location;
}
return JSON.stringify({
parse: 0,
url: url,
});
}
async function search(wd, quick) {
return '{}';
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。