X/cat/douyu_open.js

233 lines
38 KiB
JavaScript
Raw Normal View History

2023-12-06 10:44:46 +02:00
import { _ } from 'assets://js/lib/cat.js';
let host = '';
let customArea = '';
let dataFrom = 'official';
let isJustLive = false;
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, method) {
let resRaw = await req(reqUrl, {
method: method || 'get',
headers: {
'User-Agent': MOBILE_UA,
},
});
return resRaw;
}
async function request(reqUrl) {
let resRaw = await requestRaw(reqUrl)
return resRaw.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
if (cfg.hasOwnProperty('ext')) {
if (cfg.ext.hasOwnProperty('custom')) {
customArea = cfg.ext.custom;
}
if (cfg.ext.hasOwnProperty('from')) {
dataFrom = cfg.ext.from;
}
}
if (dataFrom == 'justlive') {
host = 'http://live.yj1211.work';
isJustLive = true;
} else {
host = 'https://m.douyu.com';
}
}
async function home(filter) {
let classes = [{"type_id":"PCgame","type_name":"网游竞技"},{"type_id":"syxx","type_name":"手游休闲"},{"type_id":"djry","type_name":"单机热游"},{"type_id":"kjwh","type_name":"科技文化"},{"type_id":"yl","type_name":"娱乐天地"},{"type_id":"yp","type_name":"语音互动"},{"type_id":"voice","type_name":"语音直播"}];
let filterObj = {
"PCgame":[{"key":"cateId","name":"分类","init":"LOL","value":[{"n":"英雄联盟","v":"LOL"},{"n":"热门游戏","v":"rmyx"},{"n":"穿越火线","v":"CF"},{"n":"重生边缘","v":"CSBYOL"},{"n":"无畏契约","v":"VALORANT"},{"n":"CFHD","v":"CFHD"},{"n":"命运方舟","v":"LostArk"},{"n":"DNF","v":"DNF"},{"n":"DOTA2","v":"DOTA2"},{"n":"使命召唤","v":"COD"},{"n":"炉石传说","v":"How"},{"n":"CS2","v":"CounterStrike"},{"n":"lol云顶之弈","v":"ydzhy"},{"n":"魔兽争霸","v":"mszb"},{"n":"魔兽怀旧服","v":"wowclassic"},{"n":"自走棋","v":"dota2rpg"},{"n":"传奇","v":"cq"},{"n":"跑跑卡丁车","v":"Popkart"},{"n":"网易游戏","v":"wyyx"},{"n":"星际争霸","v":"SC"},{"n":"守望先锋","v":"Overwatch"},{"n":"DOTA","v":"DOTA"},{"n":"魔兽世界","v":"WOW"},{"n":"剑网3","v":"JX3"},{"n":"我的世界","v":"MC"},{"n":"超激斗梦境","v":"cjdmj"},{"n":"冒险岛","v":"mxd"},{"n":"三国杀","v":"sanguosha"},{"n":"梦幻西游","v":"MHXYOL"},{"n":"天涯明月刀","v":"tianya"},{"n":"街头篮球","v":"jtlq"},{"n":"NBA2KOL2","v":"NBA2KOL2"},{"n":"QQ飞车端游","v":"qqfcdy"},{"n":"军事游戏","v":"jsyx"},{"n":"棋牌娱乐","v":"qipai"},{"n":"FC ONLINE","v":"FCOL"},{"n":"热门网游","v":"rmwy"},{"n":"卡拉彼丘","v":"klbq"},{"n":"诛仙世界","v":"zxsj"},{"n":"APEX","v":"APEX"},{"n":"流放之路POE","v":"PathofExile"},{"n":"剑网3缘起","v":"JW3YQ"},{"n":"逆水寒","v":"nsh"},{"n":"风暴英雄","v":"HOTS"},{"n":"逆战","v":"NZ"},{"n":"坦克世界","v":"TKSJ"},{"n":"战舰世界","v":"wfws"},{"n":"反恐精英Online","v":"CS"},{"n":"暗黑破坏神","v":"DIABLO"},{"n":"梦三国2","v":"msg2"},{"n":"传奇世界","v":"cqsj"},{"n":"方舟:生存进化","v":"fzscjh"},{"n":"神武4电脑版","v":"swdnb"},{"n":"群雄逐鹿","v":"qxzl"},{"n":"堡垒之夜","v":"blzy"},{"n":"无限法则","v":"roe"},{"n":"问道电脑版","v":"wddnb"},{"n":"西山居游戏","v":"Seasun"},{"n":"最终幻想14","v":"FF14"},{"n":"战意","v":"WYZY"},{"n":"剑灵","v":"BladeSoul"},{"n":"星际战甲","v":"Warframe"},{"n":"龙之谷","v":"DragonNest"},{"n":"铁甲雄兵","v":"tjxb"},{"n":"古剑奇谭网络版","v":"gjqtwlb"},{"n":"轩辕传奇","v":"XYCQ"},{"n":"神途","v":"shentu"},{"n":"激战2","v":"GuildWars2"},{"n":"高达文化区","v":"gdyxq"},{"n":"忍者村大战2","v":"rzcdz2"},{"n":"RPG网游专区","v":"rpgwyzq"},{"n":"诛仙3","v":"zhuxian3"},{"n":"笑傲江湖OL","v":"xajhol"},{"n":"冒险岛2","v":"MXD2"},{"n":"超击突破","v":"SuperPeople"},{"n":"无尽战区","v":"WJZQ"},{"n":"永恒之塔","v":"AION"},{"n":"竞速游戏","v":"jingsu"},{"n":"FPS综合网游","v":"FPSOL"},{"n":"劲舞团","v":"jwt"},{"n":"天下","v":"tianxai"},{"n":"火箭联盟","v":"hjlm"},{"n":"泡泡堂","v":"ppt"},{"n":"音乐游戏","v":"MG"},{"n":"新倩女幽魂","v":"ONLINE"},{"n":"天谕","v":"tianyu"},{"n":"QQ炫舞","v":"qqxw"},{"n":"大唐无双","v":"dtws"},{"n":"怪物猎人ol","v":"MHol"},{"n":"手工星球","v":"sgxq"},{"n":"热血传奇:本源","v":"rxcqhjsgb"},{"n":"彩虹岛","v":"CHD"},{"n":"御龙在天","v":"YLZT"},{"n":"自由篮球","v":"ZYLQ"},{"n":"洛奇英雄传","v":"LQYXZ"},{"n":"洛奇","v":"LQ"},{"n":"封印者","v":"FYZ"},{"n":"合金弹头","v":"HJDT"},{"n":"新英雄年代","v":"XYXSD"},{"n":"盛趣游戏","v":"SQYX"},{"n":"新热血英豪","v":"XRXYH"},{"n":"沙盒游戏","v":"SHYX"},{"n":"恐鬼症","v":"KGZ"},{"n":"领地人生","v":"LDRS"},{"n":"大话西游2","v":"dhxy2"},{"n":"猎人","v":"lr"},{"n":"热血江湖online","v":"rxjhol"},{"n":"千年3","v":"qn3"},{"n":"逍遥情缘","v":"xyqy"},{"n":"快乐西游","v":"klxy"},{"n":"诺亚传说","v":"nycs"},{"n":"鹿鼎记","v":"ldj"},{"n":"武魂2电脑版","v":"wh2pc"},{"n":"奇迹世界sun","v":"qjsjsun"},{"n":"剑侠世界2电脑版","v":"jxsj2pc"},{"n":"斩魂","v":"zhpc"},{"n":"大唐2","v":"dt2pc"},{"n":"幻想神域电脑版","v":"hxsypc"},{"n":"蜀山:初章","v":"ssczpc"},{"n":"狼人对决网游","v":"lrdjpc"},{"n":"武林群侠传","v":"wlqxzpc"},{"n":"飘流幻境","v":"plhjpc"},{"n":"破天一剑","v":"ptyj"},{"n"
"syxx":[{"key":"cateId","name":"分类","init":"wzry","value":[{"n":"王者荣耀","v":"wzry"},{"n":"LOL手游","v":"LOLM"},{"n":"崩坏:星穹铁道","v":"bhxqtd"},{"n":"逆水寒手游","v":"NSHM"},{"n":"和平精英","v":"hpjy"},{"n":"暗区突围","v":"aqtw"},{"n":"蛋仔派对","v":"dzpd"},{"n":"高能英雄","v":"gnyx"},{"n":"幻塔","v":"ht"},{"n":"火影忍者","v":"hyrz"},{"n":"COD手游","v":"smzhsy"},{"n":"lol电竞经理","v":"EGAME"},{"n":"DNF手游","v":"mdnf"},{"n":"金铲铲之战","v":"JGAME"},{"n":"天刀手游","v":"tdsy"},{"n":"原神","v":"yuanshen"},{"n":"航海王热血航线","v":"HHWRXHX"},{"n":"元梦之星","v":"YMZX"},{"n":"鸿图之下","v":"htzx"},{"n":"欢乐麻将","v":"HLMJ"},{"n":"王者模拟战","v":"wzrpg"},{"n":"中国象棋","v":"ZGXQ"},{"n":"天谕手游","v":"tysy"},{"n":"巅峰坦克","v":"DFTK"},{"n":"新游中心","v":"xyzx"},{"n":"热门手游","v":"phone"},{"n":"梦幻手游","v":"mhxy"},{"n":"QQ飞车","v":"qqfcsy"},{"n":"第五人格","v":"dwrg"},{"n":"欢乐斗地主","v":"hlddz"},{"n":"荒野乱斗","v":"hyld"},{"n":"阴阳师","v":"yys"},{"n":"狼人杀","v":"LRS"},{"n":"JJ斗地主","v":"jj"},{"n":"梦幻新诛仙","v":"mhxzx"},{"n":"多多自走棋","v":"zzq"},{"n":"崩坏3","v":"bhxl"},{"n":"风云岛行动","v":"fydxd"},{"n":"云游戏","v":"cloudgame"},{"n":"跑跑手游","v":"PPKDCSY"},{"n":"率土之滨","v":"stzb"},{"n":"灌篮高手","v":"glgs"},{"n":"皇室战争","v":"hszz"},{"n":"忍者必须死3","v":"rzbxs3"},{"n":"神武4手游","v":"sw3"},{"n":"梦幻模拟战","v":"mhmnz"},{"n":"实况足球","v":"skzq"},{"n":"航海王:燃烧意志","v":"hhwrsyz"},{"n":"球球大作战","v":"qqdzz"},{"n":"英雄杀","v":"yxs"},{"n":"魔域口袋版","v":"mykdb"},{"n":"口袋新旅程","v":"KDXLC"},{"n":"剑网3指尖江湖","v":"jw3zjjh"},{"n":"部落冲突","v":"blct"},{"n":"剑与家园","v":"jyjy"},{"n":"新笑傲江湖","v":"xxajh"},{"n":"猫和老鼠","v":"mhls"},{"n":"猎人手游","v":"lrlr"},{"n":"明日之后","v":"mrzh"},{"n":"影之诗","v":"yzs"},{"n":"决战平安京","v":"jzpaj"},{"n":"魂斗罗归来","v":"DLHGL"},{"n":"圣斗士星矢","v":"sdsxs"},{"n":"魔力宝贝手游","v":"mlbbsy"},{"n":"哈利波特:魔法觉醒","v":"HarryPotter"},{"n":"手游推广","v":"rmsy"},{"n":"魔灵召唤","v":"mlzh"},{"n":"香肠派对","v":"xcpd"},{"n":"迷你世界","v":"MNSJ"},{"n":"FC足球世界","v":"FCZQSJ"},{"n":"街篮","v":"jl"},{"n":"明日方舟","v":"mrfz"},{"n":"一梦江湖","v":"ymjh"},{"n":"完美世界手游","v":"wmsjsy"},{"n":"拳皇98OL","v":"kof98"},{"n":"赛尔号","v":"srh"},{"n":"仙境传说","v":"xjcs"},{"n":"流星群侠传","v":"liuxinghudiejian"},{"n":"逃跑吧少年","v":"tpbsn"},{"n":"石器时代","v":"sqsd"},{"n":"RPG手游","v":"rpgsy"},{"n":"英魂之刃口袋版","v":"yh"},{"n":"倩女幽魂手游","v":"qnyhsy"},{"n":"决斗之城2","v":"jdzc2"},{"n":"传奇手游","v":"cqsy"},{"n":"雀魂","v":"Majsoul"},{"n":"二次元手游","v":"ecysy"},{"n":"征途2手游","v":"zt2sy"},{"n":"万王之王3D","v":"wwzw3D"},{"n":"武林外传","v":"wlwz"},{"n":"潮人篮球","v":"crlq"},{"n":"元气骑士","v":"yuanqiqishi"},{"n":"红警OL手游","v":"hjolsy"},{"n":"植物大战僵尸手游","v":"ZWDZJS"},{"n":"创造与魔法","v":"ccymf"},{"n":"奇迹觉醒","v":"qjjx"},{"n":"光遇","v":"skygy"},{"n":"游戏王:决斗链接","v":"yxwjdlj"},{"n":"巅峰战舰","v":"dfzj"},{"n":"寻仙","v":"xunxian"},{"n":"天天象棋","v":"ttxq"},{"n":"王国纪元","v":"wgjy"},{"n":"龙族幻想","v":"lzhx"},{"n":"三国杀移动版","v":"SGSSY"},{"n":"罗布乐思","v":"Roblox"},{"n":"足球手游","v":"zqsy"},{"n":"月圆之夜","v":"yyzy"},{"n":"秦时明月世界","v":"qsmysj"},{"n":"麻将来了","v":"mjll"},{"n":"风之大陆","v":"fzdl"},{"n":"金属对决","v":"jsdj"},{"n":"轩辕剑龙舞云山","v":"xyjlwys"},{"n":"微乐棋牌","v":"WLQP"},{"n":"辐射避难所Online","v":"fsbnsonline"},{"n":"街篮2","v":"jl2"},{"n":"极光计划","v":"jgjh"},{"n":"不良人3","v":"blr3"},{"n":"镇魔曲手游","v":"zmq"},{"n":"乱世王者"
"djry":[{"key":"cateId","name":"分类","init":"TVgame","value":[{"n":"主机游戏","v":"TVgame"},{"n":"刺客信条:英灵殿","v":"AC"},{"n":"马里奥制造","v":"Mario"},{"n":"逃离塔科夫","v":"EFT"},{"n":"命运2","v":"MY2"},{"n":"恐怖游戏","v":"Horror"},{"n":"荒野大镖客","v":"hydbk"},{"n":"灵魂筹码","v":"lhcm"},{"n":"骑马与砍杀","v":"MountAndBlade"},{"n":"只狼","v":"ZL"},{"n":"格斗游戏","v":"FTG"},{"n":"饥荒","v":"DontStarve"},{"n":"全境封锁","v":"qjfs"},{"n":"怀旧游戏","v":"classic"},{"n":"NBA2K","v":"NBA2K"},{"n":"八方旅人","v":"OT"},{"n":"人类一败涂地","v":"Human"},{"n":"环世界","v":"RimWorld"},{"n":"古墓丽影","v":"gmly"},{"n":"鬼泣","v":"DMC"},{"n":"往日不再","v":"WRBZ"},{"n":"仙剑奇侠传","v":"PAL"},{"n":"神秘海域","v":"Uncharted"},{"n":"塞尔达系列","v":"TLoZ"},{"n":"僵尸世界大战","v":"WWZ"},{"n":"足球游戏","v":"zq"},{"n":"橙光","v":"cg"},{"n":"了不起的修仙模拟器","v":"ACS"},{"n":"超级马里奥","v":"SMO"},{"n":"三国志系列","v":"Sangokushi"},{"n":"星际公民","v":"StarCitizen"},{"n":"最终幻想","v":"FF"},{"n":"中土世界:战争之影","v":"MiddleEarth"},{"n":"流放者柯南","v":"Conan"},{"n":"三国群英传","v":"SANGO"},{"n":"无主之地","v":"Bor"},{"n":"辐射","v":"fs"},{"n":"太吾绘卷","v":"twhj"},{"n":"SCUM","v":"Scum"},{"n":"正当防卫","v":"zdfw"},{"n":"以撒的结合","v":"Isaac"},{"n":"文明","v":"CVI"},{"n":"仁王","v":"NIOH"},{"n":"缺氧","v":"ONI"},{"n":"皇牌空战","v":"hpkz"},{"n":"体育游戏","v":"tyyx"},{"n":"海岛大亨","v":"hddh"},{"n":"植物大战僵尸:花园战争系列","v":"PvsZ"},{"n":"蜘蛛侠","v":"Spide"},{"n":"勇者斗恶龙建造者2","v":"DQB2"},{"n":"遗迹:灰烬重生","v":"Rem"},{"n":"血源","v":"BB"},{"n":"旺达与巨像","v":"SotC"},{"n":"模拟人生","v":"Sims"},{"n":"空洞骑士","v":"HKS"},{"n":"极品飞车","v":"jpfc"},{"n":"胡闹厨房","v":"Overcooked"},{"n":"地铁:离去","v":"ME"},{"n":"生死狙击2","v":"ssjjtwo"},{"n":"三国战纪","v":"sgzj"},{"n":"怀旧FC","v":"edwcy"},{"n":"经典单机","v":"jddj"},{"n":"英雄无敌","v":"HoMM"},{"n":"街机游戏","v":"jjyx"},{"n":"合金装备","v":"MetalGear"},{"n":"红色警戒","v":"hsjj"},{"n":"镜之边缘","v":"MsE"},{"n":"火焰纹章系列","v":"FireEmblem"},{"n":"星露谷物语","v":"Stardew"},{"n":"赛博朋克2077","v":"Cyberpunk"},{"n":"中国式家长","v":"CP"},{"n":"尼尔:机械纪元","v":"NieR"},{"n":"无人深空","v":"NMS"},{"n":"EVOTINCTION","v":"EVOTINCTION"},{"n":"GT赛车7","v":"GT"},{"n":"超级机器人大战","v":"SRW"},{"n":"信长之野望","v":"KOEINOBU"},{"n":"这是我的战争","v":"TWoM"},{"n":"杀戮尖塔","v":"sljt"},{"n":"冰汽时代","v":"Frostpunk"},{"n":"帝国时代","v":"AoEIV"},{"n":"死亡空间","v":"swkj"},{"n":"凯瑟琳Full Body","v":"CFB"},{"n":"足球经理","v":"Football"},{"n":"雨中冒险","v":"RoR"},{"n":"亿万僵尸","v":"Billions"},{"n":"武装突袭","v":"ArmA"},{"n":"石油大亨","v":"Oil"},{"n":"荣耀战魂","v":"Honor"},{"n":"欧洲卡车模拟器","v":"Truck"},{"n":"美国逃亡者","v":"Fugitive"},{"n":"漫漫长夜","v":"mmcy"},{"n":"永恒轮回","v":"Survival"},{"n":"孤岛惊魂","v":"FarCry"},{"n":"都市:天际线","v":"Skylines"},{"n":"盗贼之海","v":"hdzh"},{"n":"Dayz","v":"DayZ"},{"n":"60秒","v":"60S"},{"n":"俄罗斯钓鱼","v":"RF"},{"n":"猎人:荒野的召唤","v":"theHunter"},{"n":"恐怖黎明","v":"GD"},{"n":"看门狗","v":"kmg"},{"n":"真三国无双","v":"DW"},{"n":"泰拉瑞亚","v":"Terraria"},{"n":"UFC","v":"UFC"},{"n":"底特律:变人","v":"Detroit"},{"n":"恶魔城","v":"Castlevania"},{"n":"毁灭战士","v":"Doom"},{"n":"火影忍者:究极忍者风暴","v":"Naruto"},{"n":"无尽地牢","v":"DOTE"},{"n":"坎巴拉太空计划","v":"Kerbal"},{"n":"龙珠:超宇宙","v":"DBX"},{"n":"马里奥赛车","v":"MarioKart"},{"n":"模拟山羊","v":"GoatSim"},{"n":"欧陆风云","v":"EU"},{"n":"乞丐模拟器","v":"HoboToughLife"},{"n":"小偷模拟器","v":"ThiefSimulato
"kjwh":[{"key":"cateId","name":"分类","init":"qezb","value":[{"n":"数码科技","v":"smkj"},{"n":"纪录片","v":"jlp"},{"n":"成年教育","v":"jiaoyu"},{"n":"人文社科","v":"Humanities"},{"n":"企鹅直播","v":"qezb"}]}],
"yl":[{"key":"cateId","name":"分类","init":"ecy","value":[{"n":"二次元","v":"ecy"},{"n":"一起看","v":"yqk"},{"n":"音乐","v":"music"},{"n":"户外","v":"HW"},{"n":"美食","v":"ms"},{"n":"原创IP","v":"ip"},{"n":"心动派对","v":"xdpd"},{"n":"音遇恋人","v":"yinyu"},{"n":"星秀","v":"xingxiu"},{"n":"心动FM","v":"dtxs"},{"n":"娱乐推荐","v":"yltj"},{"n":"中国地质大学(武汉)","v":"CUGWH"}]}],
"yp":[{"key":"cateId","name":"分类","init":"paidui","value":[{"n":"派对","v":"paidui"},{"n":"心动FM.","v":"DIANT"},{"n":"一起玩","v":"yiqiwan"}]}],
"voice":[{"key":"cateId","name":"分类","init":"yyjy","value":[{"n":"语音交友","v":"yyjy"},{"n":"音乐之声","v":"yyzs"},{"n":"连麦互动","v":"lianmaihudong"},{"n":"娱乐开黑","v":"ylkh"}]}]
};
if (customArea.length > 0) {
const filterCfg = customArea.split('#');
classes.unshift({"type_id":"custom","type_name":"自选"});
const filterList = _.map(filterCfg, (it) => {
const filterKv = it.split(',');
return {
n: filterKv[1],
v: filterKv[0],
};
});
const defKey = filterList[0];
filterObj["custom"] = [{"key":"cateId","name":"分类","init":defKey.v,"value":filterList}];
}
if (isJustLive) {
// key-value映射修改
const filterKeys = Object.keys(filterObj);
for (const filterKey of filterKeys) {
const filterItem = filterObj[filterKey];
for (const typeItem of filterItem) {
typeItem.value = _.map(typeItem.value, (it) => {
// 修改默认值
if (it.v == typeItem.init) {
typeItem.init = it.n;
}
return {
n: it.n,
v: it.n,
};
});
}
}
}
classes.unshift({"type_id":"home","type_name":"首页"});
return JSON.stringify({
class: _.map(classes, (it) => {
return {
type_id: it.type_id,
type_name: it.type_name,
land: 1,
ratio: 1.78,
};
}),
filters: filterObj,
});
}
async function homeVod() {
return '{}';
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == 'undefined') pg = 1;
let url = '';
let videos = [];
if (isJustLive) {
if (tid == 'home') {
url = host + '/api/live/getRecommendByPlatform?platform=douyu&size=20&page=' + pg;
} else {
url = host + '/api/live/getRecommendByPlatformArea?platform=douyu&size=20&area=' + tid + '&page=' + pg;
}
const data = JSON.parse(await request(url));
videos = _.map(data.data, (it) => {
return {
vod_id: it.roomId,
vod_name: it.roomName,
vod_pic: it.roomPic,
vod_remarks: it.ownerName,
}
});
} else {
if (tid == 'home') {
url = host + '/api/room/list?page=' + pg;
} else {
url = host + '/api/room/list?type=' + extend.cateId + '&page=' + pg;
}
const data = JSON.parse(await request(url));
videos = _.map(data.data.list, (it) => {
return {
vod_id: it.rid,
vod_name: it.roomName,
vod_pic: it.roomSrc,
vod_remarks: it.nickname,
}
});
}
return JSON.stringify({
page: parseInt(pg),
pagecount: 9999,
limit: 90,
total: 999999,
list: videos,
});
}
async function detail(id) {
const data = JSON.parse(await request('http://live.yj1211.work/api/live/getRoomInfo?platform=douyu&roomId=' + id));
const video = data.data;
const vodList = [];
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: '',
vod_content: video.online + '人在线',
vod_year: '',
vod_area: '',
};
vodList.push(
{
title: "JustLive",
url: "https://getplayurl.lmteam.repl.co/live?platform=douyu&rid=" + video.roomId
},
{
title: "112114",
url: "http://epg.112114.xyz/douyu/" + video.roomId
},
{
title: "AOIS",
url: "https://www.aois.eu.org/live/douyu/" + video.roomId
},
{
title: "GIPTV",
url: "https://www.goodiptv.club/douyu/" + video.roomId
},
{
title: "KDTV",
url: "http://maomao.kandiantv.cn/douyu1.php?id=" + video.roomId
}
);
vod.vod_play_from = video.platForm;
vod.vod_play_url = _.map(vodList, (it)=> {
return it.title + "$" + it.url
}).join("#");
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
return JSON.stringify({
parse: 0,
url: id,
});
}
async function search(wd, quick) {
const resp = await requestRaw(host + '/api/search/liveRoom?did=10000000000000000000000000001501&limit=40&offset=0&sk=' + wd, 'post');
const data = JSON.parse(resp.content);
let videos = [];
for (const vod of data.data.list) {
videos.push({
vod_id: vod.roomId,
vod_name: vod.roomName,
vod_pic: vod.roomSrc,
vod_remarks: vod.nickname,
});
}
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}