Add files via upload

This commit is contained in:
dxawi 2023-10-28 12:52:29 +08:00 committed by GitHub
parent a07c1ea6a6
commit 7937c90ce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 3935 additions and 718 deletions

261
cat/230ts_book_open.js Normal file
View File

@ -0,0 +1,261 @@
// 网站搜索异常
import { load, _ } from './lib/cat.js';
let key = '爱上你听书网';
let HOST = 'https://wap.230ts.net';
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 request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || MOBILE_UA,
'Referer': HOST
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const html = await request(HOST + '/sort/');
const $ = load(html);
let filterObj = {};
const class_parse = $('dl.pd-class:first > dd > a[href*=sort]');
let classes = [];
classes = _.map(class_parse, (cls) => {
let typeId = cls.attribs['href'];
typeId = typeId.replace(/.*?\/sort\/(.*).html/g, '$1');
return {
type_id: typeId,
type_name: cls.children[0].data,
};
});
const sortName = ['玄幻有声', '灵异有声', '综艺娱乐', '长篇评书', '都市有声', '军事有声', '职场有声', '其他有声'];
classes = _.sortBy(classes, (c) => {
const index = sortName.indexOf(c.type_name);
return index === -1 ? sortName.length : index;
});
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
const link = HOST + '/top/lastupdate/1.html';
const html = await request(link);
const $ = load(html);
const items = $('ul.list-ul > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const img = $(item).find('img:first')[0];
const remarks = $($(item).find('p.module-slide-author')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/tingshu\/(.*)/g, '$1'),
vod_name: it.attribs.title.replace('有声小说',''),
vod_pic: HOST + img.attribs['data-original'],
vod_remarks: remarks || '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0) pg = 1;
const link = HOST + '/sort/' + tid +'/' + (`${pg}`) + '.html';
const html = await request(link);
const $ = load(html);
const items = $('ul.book-ol > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const img = $(item).find('img:first')[0];
const remarks = $($(item).find('div.book-meta')[0]).text().trim();
return {
book_id: it.attribs.href.replace(/.*?\/tingshu\/(.*)/g, '$1'),
book_name: it.attribs.title.replace('有声小说',''),
book_pic: HOST + img.attribs['data-original'],
book_remarks: remarks.replace('佚名(著)','').replace('佚名(播)','').replace('未知(著)','').replace('未知(播)','') || '',
};
});
const hasMore = $('div.paging > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
async function detail(id) {
const html = await request(HOST + '/tingshu/' + id);
const $ = load(html);
const detail = $('div.book-cell:first > div');
let vod = {
book_id: id,
type_name: $('h1:first').text().trim().replace('有声小说',''),
// vod_pic: HOST + $('div.myui-content__thumb img:first').attr('data-original'),
// vod_content: $('div.ellipsis').text().trim(),
book_year: '',
book_area: '',
book_remarks: '',
book_actor: '',
book_director: '',
book_content: '',
};
// for (const info of detail) {
// const i = $(info).text().trim();
// if (i.startsWith('类型:')) {
// vod.vod_type = _.map($(info).find('a'), (a) => {
// return a.children[0].data;
// }).join('/');
// } else if (i.startsWith('作者:')) {
// vod.vod_director = _.map($(info).find('a'), (a) => {
// return a.children[0].data;
// }).join('/');
// } else if (i.startsWith('演播:')) {
// vod.vod_actor = _.map($(info).find('a'), (a) => {
// return a.children[0].data;
// }).join('/');
// } else if (i.startsWith('连载中')) {
// vod.vod_remarks = i.substring(3);
// }
// }
const playlist = _.map($('#playlist > ul > li > a'), (it) => {
return it.children[0].data + '$' + it.attribs.href.replace(/\/mp3\/(.*).html/g, '$1');
}).join("#");
vod.volumes = '道长在线';
vod.urls = playlist;
// vod.vod_play_from = '道长在线';
// vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const link = HOST + '/mp3/' + id + '.html';
const html = await request(link);
const $ = load(html);
const iframe = $('body iframe[src*=player]');
const iframeHtml = (
await req(HOST + iframe[0].attribs.src, {
headers: {
'Referer': link,
'User-Agent': MOBILE_UA,
},
})
).content;
const playUrl = iframeHtml.match(/mp3:'(.*?)'/)[1];
if (playUrl.indexOf('m4a') >= 0 || playUrl.indexOf('mp3') >= 0 ) {
return JSON.stringify({
parse: 0,
url: playUrl,
});
} else {
try {
const iframeHtml = (
await req(HOST + iframe[0].attribs.src, {
headers: {
'Referer': link,
'User-Agent': MOBILE_UA,
},
})
).content;
const playUrl = playUrl + '.m4a' + iframeHtml.match(/(\?.*?)'/)[1];
if (playUrl.indexOf('http') >= 0) {
return JSON.stringify({
parse: 0,
url: playUrl,
});
} else {
const iframeHtml = (
await req(HOST + iframe[0].attribs.src, {
headers: {
'Referer': link,
'User-Agent': MOBILE_UA,
},
})
).content;
const playUrl2 = iframeHtml.match(/url[\s\S]*?(http.*?)'/)[1];
if (playUrl2.indexOf('\?') >= 0) {
return JSON.stringify({
parse: 0,
url: playUrl2,
});
} else {
const playUrl3 = playUrl2 + playUrl
return JSON.stringify({
parse: 0,
url: playUrl3,
});
}
}
} catch (e) {}
if (playUrl.indexOf('http') >= 0) {
const playUrl = playUrl + '.m4a';
return JSON.stringify({
parse: 0,
url: playUrl,
});
} else {
const iframeHtml = (
await req(HOST + iframe[0].attribs.src, {
headers: {
'Referer': link,
'User-Agent': MOBILE_UA,
},
})
).content;
const playUrl4 = iframeHtml.match(/url[\s\S]*?(http.*?)'/)[1];
return JSON.stringify({
parse: 0,
url: playUrl4 + '.m4a',
});
}
}
}
async function search(wd, quick) {
const link = HOST + '/search.html?searchtype=name&searchword=' + wd +'&page=1';
const html = await request(link);
const $ = load(html);
const items = $('ul.book-ol > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const img = $(item).find('img:first')[0];
const remarks = $($(item).find('div.book-meta')[0]).text().trim();
return {
book_id: it.attribs.href.replace(/.*?\/tingshu\/(.*)/g, '$1'),
book_name: it.attribs.title.replace('有声小说',''),
book_pic: img.attribs['data-original'],
book_remarks: remarks.replace('佚名(著)','').replace('佚名(播)','').replace('未知(著)','').replace('未知(播)','') || '',
};
});
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

1
cat/555dy_open.js Normal file

File diff suppressed because one or more lines are too long

894
cat/AppYsV2.js Normal file
View File

@ -0,0 +1,894 @@
import { Crypto, _ } from 'assets://js/lib/cat.js'
let host = '';
let header = {
'User-Agent': 'okhttp/3.12.11'
};
let siteKey = '';
let siteType = '';
let siteJx = '';
const urlPattern1 = /api\.php\/.*?\/vod/;
const urlPattern2 = /api\.php\/.+?\.vod/;
const parsePattern = /\/.+\\?.+=/;
const parsePattern1 = /.*(url|v|vid|php\?id)=/;
const parsePattern2 = /https?:\/\/[^\/]*/;
const htmlVideoKeyMatch = [
/player=new/,
/<div id="video"/,
/<div id="[^"]*?player"/,
/\/\/视频链接/,
/HlsJsPlayer\(/,
/<iframe[\s\S]*?src="[^"]+?"/,
/<video[\s\S]*?src="[^"]+?"/,
];
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
host = cfg.ext;
if (cfg.ext.hasOwnProperty('host')) { // for custom jx
host = cfg.ext.host;
siteJx = cfg.ext;
}
};
async function request(reqUrl, ua, timeout = 60000) {
let res = await req(reqUrl, {
method: 'get',
headers: ua ? ua : {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'},
timeout: timeout,
});
return res.content;
}
async function home(filter) {
try {
let url = getCateUrl(host);
let jsonArray = null;
if (url) {
const json = await request(url, getHeaders(url));
const obj = JSON.parse(json);
if (obj.hasOwnProperty("list") && Array.isArray(obj.list)) {
jsonArray = obj.list;
} else if (
obj.hasOwnProperty("data") &&
obj.data.hasOwnProperty("list") &&
Array.isArray(obj.data.list)
) {
jsonArray = obj.data.list;
} else if (obj.hasOwnProperty("data") && Array.isArray(obj.data)) {
jsonArray = obj.data;
}
} else {
// 通过filter列表读分类
const filterStr = getFilterTypes(url, null);
const classes = filterStr.split("\n")[0].split("+");
jsonArray = [];
for (let i = 1; i < classes.length; i++) {
const kv = classes[i].trim().split("=");
if (kv.length < 2) continue;
const newCls = {
type_name: kv[0].trim(),
type_id: kv[1].trim(),
};
jsonArray.push(newCls);
}
}
const result = { class: [] };
if (jsonArray != null) {
for (let i = 0; i < jsonArray.length; i++) {
const jObj = jsonArray[i];
const typeName = jObj.type_name;
if (isBan(typeName)) continue;
const typeId = jObj.type_id;
const newCls = {
type_id: typeId,
type_name: typeName,
};
const typeExtend = jObj.type_extend;
if (filter) {
const filterStr = getFilterTypes(url, typeExtend);
const filters = filterStr.split("\n");
const filterArr = [];
for (let k = (url) ? 1 : 0; k < filters.length; k++) {
const l = filters[k].trim();
if (!l) continue;
const oneLine = l.split("+");
let type = oneLine[0].trim();
let typeN = type;
if (type.includes("筛选")) {
type = type.replace(/筛选/g, "");
if (type === "class") typeN = "类型";
else if (type === "area") typeN = "地区";
else if (type === "lang") typeN = "语言";
else if (type === "year") typeN = "年份";
}
const jOne = {
key: type,
name: typeN,
value: [],
};
for (let j = 1; j < oneLine.length; j++) {
const kv = oneLine[j].trim();
const sp = kv.indexOf("=");
if (sp === -1) {
if (isBan(kv)) continue;
jOne.value.push({ n: kv, v: kv });
} else {
const n = kv.substring(0, sp);
if (isBan(n)) continue;
jOne.value.push({
n: n.trim(),
v: kv.substring(sp + 1).trim(),
});
}
}
filterArr.push(jOne);
}
if (!result.hasOwnProperty("filters")) {
result.filters = {};
}
result.filters[typeId] = filterArr;
}
result.class.push(newCls);
}
}
return JSON.stringify(result);
} catch (e) {
}
return "";
}
async function homeVod() {
try {
const apiUrl = host;
let url = getRecommendUrl(apiUrl);
let isTV = false;
if (!url) {
url = getCateFilterUrlPrefix(apiUrl) + "movie&page=1&area=&type=&start=";
isTV = true;
}
const json = await request(url, getHeaders(url));
const obj = JSON.parse(json);
const videos = [];
if (isTV) {
const jsonArray = obj.data;
for (let i = 0; i < jsonArray.length; i++) {
const vObj = jsonArray[i];
const v = {
vod_id: vObj.nextlink,
vod_name: vObj.title,
vod_pic: vObj.pic,
vod_remarks: vObj.state,
};
videos.push(v);
}
} else {
const arrays = [];
findJsonArray(obj, "vlist", arrays);
if (arrays.length === 0) {
findJsonArray(obj, "vod_list", arrays);
}
const ids = [];
for (const jsonArray of arrays) {
for (let i = 0; i < jsonArray.length; i++) {
const vObj = jsonArray[i];
const vid = vObj.vod_id;
if (ids.includes(vid)) continue;
ids.push(vid);
const v = {
vod_id: vid,
vod_name: vObj.vod_name,
vod_pic: vObj.vod_pic,
vod_remarks: vObj.vod_remarks,
};
videos.push(v);
}
}
}
const result = {
list: videos,
};
return JSON.stringify(result);
} catch (e) {
}
return "";
}
async function category(tid, pg, filter, extend) {
try {
const apiUrl = host;
let url = getCateFilterUrlPrefix(apiUrl) + tid + getCateFilterUrlSuffix(apiUrl);
url = url.replace(/#PN#/g, pg);
url = url.replace(/筛选class/g, extend?.class ?? "");
url = url.replace(/筛选area/g, extend?.area ?? "");
url = url.replace(/筛选lang/g, extend?.lang ?? "");
url = url.replace(/筛选year/g, extend?.year ?? "");
url = url.replace(/排序/g, extend?.排序 ?? "");
const json = await request(url, getHeaders(url));
const obj = JSON.parse(json);
let totalPg = Infinity;
try {
if (obj.totalpage !== undefined && typeof obj.totalpage === "number") {
totalPg = obj.totalpage;
} else if (
obj.pagecount !== undefined &&
typeof obj.pagecount === "number"
) {
totalPg = obj.pagecount;
} else if (
obj.data !== undefined &&
typeof obj.data === "object" &&
obj.data.total !== undefined &&
typeof obj.data.total === "number" &&
obj.data.limit !== undefined &&
typeof obj.data.limit === "number"
) {
const limit = obj.data.limit;
const total = obj.data.total;
totalPg = total % limit === 0 ? total / limit : Math.floor(total / limit) + 1;
}
} catch (e) {
}
const jsonArray =
obj.list !== undefined
? obj.list
: obj.data !== undefined && obj.data.list !== undefined
? obj.data.list
: obj.data;
const videos = [];
if (jsonArray !== undefined) {
for (let i = 0; i < jsonArray.length; i++) {
const vObj = jsonArray[i];
const v = {
vod_id: vObj.vod_id !== undefined ? vObj.vod_id : vObj.nextlink,
vod_name: vObj.vod_name !== undefined ? vObj.vod_name : vObj.title,
vod_pic: vObj.vod_pic !== undefined ? vObj.vod_pic : vObj.pic,
vod_remarks: vObj.vod_remarks !== undefined ? vObj.vod_remarks : vObj.state,
};
videos.push(v);
}
}
const result = {
page: pg,
pagecount: totalPg,
limit: 90,
total: Infinity,
list: videos,
};
return JSON.stringify(result);
} catch (e) {
SpiderDebug.log(e);
}
return "";
}
async function detail(ids) {
try {
const apiUrl = host;
const url = getPlayUrlPrefix(apiUrl) + ids;
const json = await request(url, getHeaders(url));
const obj = JSON.parse(json);
const result = {
list: [],
};
const vod = {};
genPlayList(apiUrl, obj, json, vod, ids);
result.list.push(vod);
return JSON.stringify(result);
} catch (e) {
}
return "";
}
const parseUrlMap = new Map();
function genPlayList(URL, object, json, vod, vid) {
const playUrls = [];
const playFlags = [];
if (URL.includes("lfytyl.com")) {
const data = object.data;
vod.vod_id = data.vod_id || vid;
vod.vod_name = data.vod_name;
vod.vod_pic = data.vod_pic;
vod.type_name = data.vod_class || "";
vod.vod_year = data.vod_year || "";
vod.vod_area = data.vod_area || "";
vod.vod_remarks = data.vod_remarks || "";
vod.vod_actor = data.vod_actor || "";
vod.vod_director = data.vod_director || "";
vod.vod_content = data.vod_content || "";
vod.vod_play_from = data.vod_play_from;
vod.vod_play_url = data.vod_play_url;
return;
}
if (URL.includes("api.php/app")) {
const data = object.data;
vod.vod_id = data.vod_id || vid;
vod.vod_name = data.vod_name;
vod.vod_pic = data.vod_pic;
vod.type_name = data.vod_class || "";
vod.vod_year = data.vod_year || "";
vod.vod_area = data.vod_area || "";
vod.vod_remarks = data.vod_remarks || "";
vod.vod_actor = data.vod_actor || "";
vod.vod_director = data.vod_director || "";
vod.vod_content = data.vod_content || "";
const vodUrlWithPlayer = data.vod_url_with_player;
for (let i = 0; i < vodUrlWithPlayer.length; i++) {
const from = vodUrlWithPlayer[i];
let flag = from.code.trim();
if (flag === "") flag = from.name.trim();
playFlags.push(flag);
playUrls.push(from.url);
let purl = from.parse_api;
const parseUrls = parseUrlMap.get(flag) || [];
if (purl && !parseUrls.includes(purl)) {
parseUrls.push(purl);
}
parseUrlMap.set(flag, parseUrls);
}
} else if (URL.includes("xgapp")) {
const data = object.data.vod_info;
vod.vod_id = data.vod_id || vid;
vod.vod_name = data.vod_name;
vod.vod_pic = data.vod_pic;
vod.type_name = data.vod_class || "";
vod.vod_year = data.vod_year || "";
vod.vod_area = data.vod_area || "";
vod.vod_remarks = data.vod_remarks || "";
vod.vod_actor = data.vod_actor || "";
vod.vod_director = data.vod_director || "";
vod.vod_content = data.vod_content || "";
const vodUrlWithPlayer = data.vod_url_with_player;
for (let i = 0; i < vodUrlWithPlayer.length; i++) {
const from = vodUrlWithPlayer[i];
let flag = from.code.trim();
if (flag === "") flag = from.name.trim();
playFlags.push(flag);
playUrls.push(from.url);
const purl = from.parse_api.trim();
const parseUrls = parseUrlMap.get(flag) || [];
if (purl && !parseUrls.includes(purl)) {
parseUrls.push(purl);
}
parseUrlMap.set(flag, parseUrls);
}
} else if (URL.includes(".vod")) {
const data = object.data;
vod.vod_id = data.vod_id || vid;
vod.vod_name = data.vod_name;
vod.vod_pic = data.vod_pic;
vod.type_name = data.vod_class || "";
vod.vod_year = data.vod_year || "";
vod.vod_area = data.vod_area || "";
vod.vod_remarks = data.vod_remarks || "";
vod.vod_actor = data.vod_actor || "";
vod.vod_director = data.vod_director || "";
vod.vod_content = data.vod_content || "";
const vodUrlWithPlayer = data.vod_play_list;
for (let i = 0; i < vodUrlWithPlayer.length; i++) {
const from = vodUrlWithPlayer[i];
let flag = from.player_info.from.trim();
if (flag === "") flag = from.player_info.show.trim();
playFlags.push(flag);
playUrls.push(from.url);
try {
const parses = [];
const parse1 = from.player_info.parse.split(",");
const parse2 = from.player_info.parse2.split(",");
parses.push(...parse1, ...parse2);
const parseUrls = parseUrlMap.get(flag) || [];
for (const purl of parses) {
if (purl.includes("http")) {
const match = purl.match(parsePattern1);
if (match) {
parseUrls.push(match[0]);
}
} else if (purl.includes("//")) {
const match = purl.match(parsePattern1);
if (match) {
parseUrls.push("http:" + match[0]);
}
} else {
const urlMatch = URL.match(parsePattern2);
if (urlMatch) {
const match = URL.match(parsePattern1);
if (match) {
parseUrls.push(urlMatch[0] + match[0]);
}
}
}
if (purl.includes("..")) purl = purl.replace(/\.\./g, ".").trim();
if (purl && !parseUrls.includes(purl)) {
parseUrls.push(purl);
}
}
parseUrlMap.set(flag, parseUrls);
} catch (e) {
}
}
} else if (URLPattern1.matcher(URL).find()) {
// Same implementation as the previous cases
}
vod.vod_play_from = playFlags.join("$$$");
vod.vod_play_url = playUrls.join("$$$");
}
async function play(flag, id, vipFlags) {
try {
// let parseUrls = parseUrlMap.get(flag);
let parseUrls = siteJx[flag]; // custom sitejx
if (!parseUrls) {
if (siteJx.hasOwnProperty('*')) { // all jx
parseUrls = siteJx['*'];
} else {
parseUrls = [];
}
}
if (parseUrls.length > 0) {
const result = await getFinalVideo(flag, parseUrls, id);
if (result !== null) {
return JSON.stringify(result);
}
}
if (isVideo(id)) {
const result = {
parse: 0,
playUrl: "",
url: id
};
return JSON.stringify(result);
} else {
const result = {
parse: 1,
jx: "1",
url: id
};
return JSON.stringify(result);
}
} catch (e) {
// Handle any error here
}
return "";
}
async function search(key, quick) {
try {
const apiUrl = host;
const url = getSearchUrl(apiUrl, encodeURIComponent(key));
const json = await request(url, getHeaders(url));
const obj = JSON.parse(json);
let jsonArray = null;
const videos = [];
if (obj.list instanceof Array) {
jsonArray = obj.list;
} else if (obj.data instanceof Object && obj.data.list instanceof Array) {
jsonArray = obj.data.list;
} else if (obj.data instanceof Array) {
jsonArray = obj.data;
}
if (jsonArray !== null) {
for (const vObj of jsonArray) {
if (vObj.vod_id) {
const v = {
vod_id: vObj.vod_id,
vod_name: vObj.vod_name,
vod_pic: vObj.vod_pic,
vod_remarks: vObj.vod_remarks
};
videos.push(v);
} else {
const v = {
vod_id: vObj.nextlink,
vod_name: vObj.title,
vod_pic: vObj.pic,
vod_remarks: vObj.state
};
videos.push(v);
}
}
}
const result = { list: videos };
return JSON.stringify(result);
} catch (error) {
}
return "";
}
async function getFinalVideo(flag, parseUrls, url) {
let htmlPlayUrl = "";
for (const parseUrl of parseUrls) {
if (parseUrl === "" || parseUrl === "null") {
continue;
}
const playUrl = parseUrl + url;
const content = await request(playUrl, null, 10000); // 10秒请求能更好过滤webjx
let tryJson = null;
try {
tryJson = jsonParse(url, content);
} catch (error) { }
if (tryJson !== null && tryJson.hasOwnProperty("url") && tryJson.hasOwnProperty("header")) {
tryJson.header = JSON.stringify(tryJson.header);
return tryJson;
}
if (content.includes("<html")) {
let sniffer = false;
for (const p of htmlVideoKeyMatch) {
if (p.test(content)) {
sniffer = true;
break;
}
}
if (sniffer) {
htmlPlayUrl = parseUrl;
}
}
}
if (htmlPlayUrl !== "") { // 不支持sniffer
const result = {
parse: 0,
playUrl: "",
url: url
};
return JSON.stringify(result);
}
return null;
}
function jsonParse(input, json) {
try {
// 处理解析接口返回的报文如果返回的报文中包含header信息就加到返回值中
let jsonPlayData = JSON.parse(json);
// 处理293的解析结果url在data字段的解析
if (jsonPlayData.hasOwnProperty("data") && typeof jsonPlayData.data === "object" && !jsonPlayData.hasOwnProperty("url")) {
jsonPlayData = jsonPlayData.data;
}
let url = jsonPlayData.url;
if (url.startsWith("//")) {
url = "https:" + url;
}
if (!url.trim().startsWith("http")) {
return null;
}
if (url === input) {
if (isVip(url) || !isVideoFormat(url)) {
return null;
}
}
if (isBlackVodUrl(input, url)) {
return null;
}
let headers = {};
if (jsonPlayData.hasOwnProperty("header")) {
headers = jsonPlayData.header;
} else if (jsonPlayData.hasOwnProperty("Header")) {
headers = jsonPlayData.Header;
} else if (jsonPlayData.hasOwnProperty("headers")) {
headers = jsonPlayData.headers;
} else if (jsonPlayData.hasOwnProperty("Headers")) {
headers = jsonPlayData.Headers;
}
let ua = "";
if (jsonPlayData.hasOwnProperty("user-agent")) {
ua = jsonPlayData["user-agent"];
} else if (jsonPlayData.hasOwnProperty("User-Agent")) {
ua = jsonPlayData["User-Agent"];
}
if (ua.trim().length > 0) {
headers["User-Agent"] = " " + ua;
}
let referer = "";
if (jsonPlayData.hasOwnProperty("referer")) {
referer = jsonPlayData.referer;
} else if (jsonPlayData.hasOwnProperty("Referer")) {
referer = jsonPlayData.Referer;
}
if (referer.trim().length > 0) {
headers["Referer"] = " " + referer;
}
headers = fixJsonVodHeader(headers, input, url);
const taskResult = {
header: headers,
url: url,
parse: "0"
};
return taskResult;
} catch (error) {
}
return null;
}
function isVip(url) {
try {
let isVip = false;
const host = new URL(url).hostname;
const vipWebsites = ["iqiyi.com", "v.qq.com", "youku.com", "le.com", "tudou.com", "mgtv.com", "sohu.com", "acfun.cn", "bilibili.com", "baofeng.com", "pptv.com"];
for (let b = 0; b < vipWebsites.length; b++) {
if (host.includes(vipWebsites[b])) {
if (vipWebsites[b] === "iqiyi.com") {
// 爱奇艺需要特殊处理
if (url.includes("iqiyi.com/a_") || url.includes("iqiyi.com/w_") || url.includes("iqiyi.com/v_")) {
isVip = true;
break;
}
} else {
isVip = true;
break;
}
}
}
return isVip;
} catch (e) {
}
return false;
}
function isBlackVodUrl(input, url) {
return url.includes("973973.xyz") || url.includes(".fit:");
}
function fixJsonVodHeader(headers, input, url) {
if (headers === null) {
headers = {};
}
if (input.includes("www.mgtv.com")) {
headers["Referer"] = " ";
headers["User-Agent"] = " Mozilla/5.0";
} else if (url.includes("titan.mgtv")) {
headers["Referer"] = " ";
headers["User-Agent"] = " Mozilla/5.0";
} else if (input.includes("bilibili")) {
headers["Referer"] = " https://www.bilibili.com/";
headers["User-Agent"] = " " + Misc.UaWinChrome;
}
return headers;
}
const snifferMatch = /http((?!http).){26,}?\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)\?.*|http((?!http).){26,}\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)|http((?!http).){26,}\/m3u8\?pt=m3u8.*|http((?!http).)*?default\.ixigua\.com\/.*|http((?!http).)*?cdn-tos[^\?]*|http((?!http).)*?\/obj\/tos[^\?]*|http.*?\/player\/m3u8play\.php\?url=.*|http.*?\/player\/.*?[pP]lay\.php\?url=.*|http.*?\/playlist\/m3u8\/\?vid=.*|http.*?\.php\?type=m3u8&.*|http.*?\/download.aspx\?.*|http.*?\/api\/up_api.php\?.*|https.*?\.66yk\.cn.*|http((?!http).)*?netease\.com\/file\/.*/;
function isVideoFormat(url) {
if (snifferMatch.test(url)) {
return !url.includes("cdn-tos") || !url.includes(".js");
}
return false;
}
function isVideo(url) {
if (!url.includes(".mp4") || !url.includes(".m3u8")) {
return true;
}
return false;
}
function UA(url) {
if (url.includes(".vod")) {
return "okhttp/4.1.0";
}
}
function getCateUrl(URL) {
if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return URL + "nav?token=";
} else if (URL.includes(".vod")) {
return URL + "/types";
} else {
return "";
}
}
function getPlayUrlPrefix(URL) {
if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return URL + "video_detail?id=";
} else if (URL.includes(".vod")) {
return URL + "/detail?vod_id=";
} else {
return "";
}
}
function getRecommendUrl(URL) {
if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return URL + "index_video?token=";
} else if (URL.includes(".vod")) {
return URL + "/vodPhbAll";
} else {
return "";
}
}
function getFilterTypes(URL, typeExtend) {
let str = "";
if (typeExtend !== null) {
for (let key in typeExtend) {
if (key === "class" || key === "area" || key === "lang" || key === "year") {
try {
str += "筛选" + key + "+全部=+" + typeExtend[key].replace(/,/g, "+") + "\n";
} catch (e) { }
}
}
}
if (URL.includes(".vod")) {
str += "\n" + "排序+全部=+最新=time+最热=hits+评分=score";
} else if (URL.includes("api.php/app") || URL.includes("xgapp")) {
// Do nothing, leave the string as it is.
} else {
str = "分类+全部=+电影=movie+连续剧=tvplay+综艺=tvshow+动漫=comic+4K=movie_4k+体育=tiyu\n筛选class+全部=+喜剧+爱情+恐怖+动作+科幻+剧情+战争+警匪+犯罪+动画+奇幻+武侠+冒险+枪战+恐怖+悬疑+惊悚+经典+青春+文艺+微电影+古装+历史+运动+农村+惊悚+惊悚+伦理+情色+福利+三级+儿童+网络电影\n筛选area+全部=+大陆+香港+台湾+美国+英国+法国+日本+韩国+德国+泰国+印度+西班牙+加拿大+其他\n筛选year+全部=+2023+2022+2021+2020+2019+2018+2017+2016+2015+2014+2013+2012+2011+2010+2009+2008+2007+2006+2005+2004+2003+2002+2001+2000";
}
return str;
}
function getCateFilterUrlSuffix(URL) {
if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return "&class=筛选class&area=筛选area&lang=筛选lang&year=筛选year&limit=18&pg=#PN#";
} else if (URL.includes(".vod")) {
return "&class=筛选class&area=筛选area&lang=筛选lang&year=筛选year&by=排序&limit=18&page=#PN#";
} else {
return "&page=#PN#&area=筛选area&type=筛选class&start=筛选year";
}
}
function getCateFilterUrlPrefix(URL) {
if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return URL + "video?tid=";
} else if (URL.includes(".vod")) {
return URL + "?type=";
} else {
return URL + "?ac=list&class=";
}
}
function isBan(key) {
return key === "伦理" || key === "情色" || key === "福利";
}
function getSearchUrl(URL, KEY) {
if (URL.includes(".vod")) {
return URL + "?wd=" + KEY + "&page=";
} else if (URL.includes("api.php/app") || URL.includes("xgapp")) {
return URL + "search?text=" + KEY + "&pg=";
} else if (urlPattern1.test(URL)) {
return URL + "?ac=list&zm=" + KEY + "&page=";
}
return "";
}
function findJsonArray(obj, match, result) {
Object.keys(obj).forEach((k) => {
try {
const o = obj[k];
if (k === match && Array.isArray(o)) {
result.push(o);
}
if (typeof o === "object" && o !== null) {
if (Array.isArray(o)) {
o.forEach((item) => {
if (typeof item === "object" && item !== null) {
findJsonArray(item, match, result);
}
});
} else {
findJsonArray(o, match, result);
}
}
} catch (e) {
}
});
}
function jsonArr2Str(array) {
const strings = [];
for (let i = 0; i < array.length; i++) {
try {
strings.push(array[i]);
} catch (e) {
}
}
return strings.join(",");
}
function getHeaders(URL) {
const headers = {};
headers["User-Agent"] = UA(URL);
return headers;
}
function isJsonString(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

137
cat/MyCatBookan.js Normal file
View File

@ -0,0 +1,137 @@
import { _ } from './lib/cat.js';
let key = 'bookan';
let url = 'https://api.bookan.com.cn';
let siteKey = '';
let siteType = 0;
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
return JSON.stringify({
class: [
{ type_id: '1305', type_name: '少年读物' },
{ type_id: '1304', type_name: '儿童文学' },
{ type_id: '1320', type_name: '国学经典' },
{ type_id: '1306', type_name: '文艺少年' },
{ type_id: '1309', type_name: '育儿心经' },
{ type_id: '1310', type_name: '心理哲学' },
{ type_id: '1307', type_name: '青春励志' },
{ type_id: '1312', type_name: '历史小说' },
{ type_id: '1303', type_name: '故事会' },
{ type_id: '1317', type_name: '音乐戏剧' },
{ type_id: '1319', type_name: '相声评书' },
],
});
}
async function category(tid, pg, filter, extend) {
pg = pg || 1;
if (pg == 0) pg = 1;
let content = await request(`${url}/voice/book/list?instance_id=25304&page=${pg}&category_id=${tid}&num=24`);
let data = JSON.parse(content).data;
let books = [];
for (const book of data.list) {
books.push({
vod_id: book.id,
vod_name: book.name,
vod_pic: book.cover,
vod_remarks: book.extra.author,
});
}
return JSON.stringify({
page: data.current_page,
pagecount: data.last_page,
limit: 24,
total: data.total,
list: books,
});
}
async function detail(id) {
let content = await request(`${url}/voice/album/units?album_id=${id}&page=1&num=200&order=1`);
let data = JSON.parse(content).data;
console.log(JSON.stringify(data));
let book = {
vod_id: id,
type_name: '',
vod_year: '',
vod_area: '',
vod_remarks: '',
vod_actor: '',
vod_director: '',
vod_content: '',
};
let us = _.map(data.list, function (b) {
return formatPlayUrl(b.title) + '$' + b.file;
}).join('#');
book.vod_play_from = '书卷';
book.vod_play_url = us;
return JSON.stringify({
list: [book],
});
}
function formatPlayUrl(name) {
return name
.trim()
.replace(/<|>|\.《.*?》/g, '. ')
.replace(/\$|#/g, ' ')
.trim();
}
async function proxy(segments, headers) {}
async function play(flag, id, flags) {
return JSON.stringify({
parse: 0,
url: id,
});
}
async function search(wd, quick, pg) {
pg = pg || 1;
if (pg == 0) pg = 1;
let content = await request(`https://es.bookan.com.cn/api/v3/voice/book?instanceId=25304&keyword=${wd}&pageNum=${pg}&limitNum=20`);
let data = JSON.parse(content).data;
let books = [];
for (const book of data.list) {
books.push({
vod_id: book.id,
vod_name: book.name,
vod_pic: book.cover,
vod_remarks: book.extra.author,
});
}
return JSON.stringify({
page: data.current_page,
pagecount: data.last_page,
limit: 20,
total: data.total,
list: books,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
category: category,
detail: detail,
play: play,
search: search,
};
}

211
cat/MyCatLibvio.js Normal file
View File

@ -0,0 +1,211 @@
// 自动从 地址发布页 获取&跳转url地址
import { load, _ } from './lib/cat.js';
var key = 'libvio';
var HOST = 'https://libvio.app'; // 地址发布页
var host = '';
var siteKey = '';
var 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 request(reqUrl, agentSp) {
var res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || MOBILE_UA,
'Referer': host
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
var html = await request(HOST);
var $ = load(html);
host = $('div.content-top > ul > li').find('a:first')[0].attribs.href;
// console.debug('libvio跳转地址 =====>' + urls); // js_debug.log
}
async function home(filter) {
var html = await request(host);
var $ = load(html);
var class_parse = $('ul.stui-header__menu > li > a[href*=type]');
var classes = [];
classes = _.map(class_parse, (cls) => {
var typeId = cls.attribs['href'];
typeId = typeId.substring(typeId.lastIndexOf('/') + 1).replace('.html','');
return {
type_id: typeId,
type_name: cls.children[0].data,
};
});
var filterObj = {
1:[{key:'area',name:'地区',value:[{n:'全部',v:''},{n:'中国大陆',v:'中国大陆'},{n:'中国香港',v:'中国香港'},{n:'中国台湾',v:'中国台湾'},{n:'美国',v:'美国'},{n:'法国',v:'法国'},{n:'英国',v:'英国'},{n:'日本',v:'日本'},{n:'韩国',v:'韩国'},{n:'德国',v:'德国'},{n:'泰国',v:'泰国'},{n:'印度',v:'印度'},{n:'意大利',v:'意大利'},{n:'西班牙',v:'西班牙'},{n:'加拿大',v:'加拿大'},{n:'其他',v:'其他'}]},{key:'year',name:'年份',value:[{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'}]},{key:'lang',name:'语言',value:[{n:'全部',v:''},{n:'国语',v:'国语'},{n:'英语',v:'英语'},{n:'粤语',v:'粤语'},{n:'闽南语',v:'闽南语'},{n:'韩语',v:'韩语'},{n:'日语',v:'日语'},{n:'法语',v:'法语'},{n:'德语',v:'德语'},{n:'其它',v:'其它'}]},{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}],
2:[{key:'area',name:'地区',value:[{n:'全部',v:''},{n:'中国大陆',v:'中国大陆'},{n:'中国台湾',v:'中国台湾'},{n:'中国香港',v:'中国香港'},{n:'韩国',v:'韩国'},{n:'日本',v:'日本'},{n:'美国',v:'美国'},{n:'泰国',v:'泰国'},{n:'英国',v:'英国'},{n:'新加坡',v:'新加坡'},{n:'其他',v:'其他'}]},{key:'year',name:'年份',value:[{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'}]},{key:'lang',name:'语言',value:[{n:'全部',v:''},{n:'国语',v:'国语'},{n:'英语',v:'英语'},{n:'粤语',v:'粤语'},{n:'闽南语',v:'闽南语'},{n:'韩语',v:'韩语'},{n:'日语',v:'日语'},{n:'其它',v:'其它'}]},{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}],
4:[{key:'area',name:'地区',value:[{n:'全部',v:''},{n:'中国',v:'中国'},{n:'日本',v:'日本'},{n:'欧美',v:'欧美'},{n:'其他',v:'其他'}]},{key:'year',name:'年份',value:[{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'},{n:'2009',v:'2009'},{n:'2008',v:'2008'},{n:'2007',v:'2007'},{n:'2006',v:'2006'},{n:'2005',v:'2005'},{n:'2004',v:'2004'}]},{key:'lang',name:'语言',value:[{n:'全部',v:''},{n:'国语',v:'国语'},{n:'英语',v:'英语'},{n:'粤语',v:'粤语'},{n:'闽南语',v:'闽南语'},{n:'韩语',v:'韩语'},{n:'日语',v:'日语'},{n:'其它',v:'其它'}]},{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}],
27:[{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}],
15:[{key:'area',name:'地区',value:[{n:'全部',v:''},{n:'日本',v:'日本'},{n:'韩国',v:'韩国'}]},{key:'year',name:'年份',value:[{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'}]},{key:'lang',name:'语言',value:[{n:'全部',v:''},{n:'国语',v:'国语'},{n:'英语',v:'英语'},{n:'粤语',v:'粤语'},{n:'闽南语',v:'闽南语'},{n:'韩语',v:'韩语'},{n:'日语',v:'日语'},{n:'其它',v:'其它'}]},{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}],
16:[{key:'area',name:'地区',value:[{n:'全部',v:''},{n:'美国',v:'美国'},{n:'英国',v:'英国'},{n:'德国',v:'德国'},{n:'加拿大',v:'加拿大'},{n:'其他',v:'其他'}]},{key:'year',name:'年份',value:[{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'}]},{key:'lang',name:'语言',value:[{n:'全部',v:''},{n:'国语',v:'国语'},{n:'英语',v:'英语'},{n:'粤语',v:'粤语'},{n:'闽南语',v:'闽南语'},{n:'韩语',v:'韩语'},{n:'日语',v:'日语'},{n:'其它',v:'其它'}]},{key:'by',name:'排序',value:[{n:'时间',v:'time'},{n:'人气',v:'hits'},{n:'评分',v:'score'}]}]
};
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
var link = host + '/show/1--hits---------.html';
var html = await request(link);
var $ = load(html);
var items = $('ul.stui-vodlist > li');
let videos = _.map(items, (item) => {
var a = $(item).find('a:first')[0];
var remarks = $($(item).find('span.pic-text')[0]).text().trim();
return {
vod_id: a.attribs.href.replace(/.*?\/detail\/(.*).html/g, '$1'),
vod_name: a.attribs.title,
vod_pic: a.attribs['data-original'],
vod_remarks: remarks || '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
var link = host + '/show/' + tid + '-' + (extend.area || '') + '-' + (extend.by || 'time') + '--' + (extend.lang || '') + '----' + pg + '---' + (extend.year || '') + '.html';
var html = await request(link);
var $ = load(html);
var items = $('ul.stui-vodlist > li');
let videos = _.map(items, (item) => {
var a = $(item).find('a:first')[0];
var remarks = $($(item).find('span.pic-text')[0]).text().trim();
return {
vod_id: a.attribs.href.replace(/.*?\/detail\/(.*).html/g, '$1'),
vod_name: a.attribs.title,
vod_pic: a.attribs['data-original'],
vod_remarks: remarks || '',
};
});
var hasMore = $('ul.stui-page__item > li > a:contains(下一页)').length > 0;
var pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
async function detail(id) {
var html = await request(host + '/detail/' + id + '.html');
var $ = load(html);
var vod = {
vod_id: id,
vod_name: $('h1:first').text().trim(),
vod_type: $('.stui-content__detail p:first a').text(),
vod_actor: $('.stui-content__detail p:nth-child(3)').text().replace('主演:',''),
vod_pic: $('.stui-content__thumb img:first').attr('data-original'),
vod_remarks : $('.stui-content__detail p:nth-child(5)').text() || '',
vod_content: $('span.detail-content').text().trim(),
};
var playMap = {};
var tabs = $('div.stui-pannel__head > h3[class*=iconfont]');
var playlists = $('ul.stui-content__playlist');
_.each(tabs, (tab, i) => {
var from = tab.children[0].data;
var list = playlists[i];
list = $(list).find('a');
_.each(list, (it) => {
var title = it.children[0].data;
var playUrl = it.attribs.href;
if (title.length == 0) title = it.children[0].data.trim();
if (!playMap.hasOwnProperty(from)) {
playMap[from] = [];
}
playMap[from].push( title + '$' + playUrl);
});
});
vod.vod_play_from = _.keys(playMap).join('$$$');
var urls = _.values(playMap);
var vod_play_url = _.map(urls, (urlist) => {
return urlist.join('#');
});
vod.vod_play_url = vod_play_url.join('$$$');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
var html = await request(host + id);
if (/"url":"https:.+?pan.quark.cn.+?"/.test(html)) {
const pushUrl = 'mpush://' + html.match(/"url":"(https:.+?pan.quark.cn.+?)"/)[1].replace(/\\/g, '');
console.log('====>>>>' + pushUrl);
return JSON.stringify({
parse: 0,
url: pushUrl
});
}
if (/"url":"https:.+?www.aliyundrive.com.+?"/.test(html)) {
const pushUrl = 'mpush://' + html.match(/"url":"(https:.+?www.aliyundrive.com.+?)"/)[1].replace(/\\/g, '');
console.log('====>>>>' + pushUrl);
return JSON.stringify({
parse: 0,
url: pushUrl
});
}
html = html.match(/r player_.*?=(.*?)</)[1];
var js = JSON.parse(html);
var url = js.url;
var from = js.from;
var next = js.link_next;
var id = js.id;
var nid = js.nid;
var paurl = await request(host +'/static/player/' + from + '.js');
paurl = paurl.match(/ src="(.*?)'/)[1];
var purl = paurl + url + '&next=' + next + '&id=' + id + '&nid=' + nid;
var playUrl = await request(purl);
playUrl = playUrl.match(/var .* = '(.*?)'/)[1];
console.debug('libvio playUrl =====>' + playUrl); // js_debug.log
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
async function search(wd, quick) {
var data = JSON.parse(await request(host + '/index.php/ajax/suggest?mid=1&wd=' + wd + '&limit=50')).list;
var videos = [];
for (const vod of data) {
videos.push({
vod_id: vod.id,
vod_name: vod.name,
vod_pic: vod.pic,
vod_remarks: '',
});
}
return JSON.stringify({
list: videos,
limit: 50,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

162
cat/MyDJ0898.js Normal file
View File

@ -0,0 +1,162 @@
import { load, _ } from "./lib/cat.js";
let key = "世纪DJ音乐网_book";
let HOST = "http://m.dj0898.com";
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 request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: "get",
headers: {
"User-Agent": agentSp || MOBILE_UA,
Referer: HOST,
},
});
return res.content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const classes = [{ type_id: 1, type_name: "🎧串烧舞曲" }, { type_id: 2, type_name: "🎧外文舞曲" }, { type_id: 3, type_name: "🎧早场暖场" }, { type_id: 4, type_name: "🎧中文舞曲" }, { type_id: 5, type_name: "🎧其他舞曲" }, { type_id: 6, type_name: "🎧国外电音" }, { type_id: 8, type_name: "🎧慢歌连版" }, { type_id: 9, type_name: "🎧酒吧潮歌" }, { type_id: 10, type_name: "🎧中文串烧" }, { type_id: 11, type_name: "🎧外文串烧" }, { type_id: 12, type_name: "🎧中外串烧" }, { type_id: 13, type_name: "🎧车载串烧" }, { type_id: 14, type_name: "🎧越鼓串烧" }, { type_id: 40, type_name: "🎧3D/环绕" }, { type_id: 45, type_name: "🎧口水旋律" }, { type_id: 46, type_name: "🎧精品收藏" }, { type_id: 47, type_name: "🎧开场舞曲" }, { type_id: 48, type_name: "🎧印度舞曲" }, { type_id: 49, type_name: "🎧编排套曲" }, { type_id: 20, type_name: "🎧DuTch" }, { type_id: 21, type_name: "🎧Mash up" }, { type_id: 22, type_name: "🎧ClubHouse" }, { type_id: 23, type_name: "🎧ElectroHouse" }, { type_id: 24, type_name: "🎧越南鼓Dj" }, { type_id: 30, type_name: "🎧Funky" }, { type_id: 31, type_name: "🎧Reggae" }, { type_id: 32, type_name: "🎧Rnb" }, { type_id: 33, type_name: "🎧Hip Hop" }, { type_id: 34, type_name: "🎧Dubstep" }, { type_id: 8017, type_name: "🎧Hardstyle" }, { type_id: 8018, type_name: "🎧Hands Up" }];
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
return cls;
}),
filters: filterObj,
});
}
async function homeVod() {
const link = HOST + "/dance/lists/id/10/1";
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font")[5];
return {
vod_id: a.attribs.href,
vod_name: tt.children[0].data,
vod_pic: img.attribs["src"],
vod_remarks: "🎵" + remarks.children[0].data || "",
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
const link = HOST + "/dance/lists/id/" + tid + "/" + pg;
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font")[5];
return {
vod_id: a.attribs.href,
vod_name: tt.children[0].data,
vod_pic: img.attribs["src"],
vod_remarks: "🎵" + remarks.children[0].data || "",
};
});
const hasMore = $("ul.page_link > li > a:contains(\u00a0)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 60,
total: 60 * pgCount,
list: videos,
});
}
async function detail(id) {
const vod = {
vod_id: id,
type_name: '',
vod_year: '',
vod_area: '',
vod_remarks: '',
vod_actor: '',
vod_director: '',
vod_content: '',
};
const playlist = ["点击播放" + "$" + vod.vod_id];
vod.vod_play_from = "DJ";
vod.vod_play_url = playlist.join("#");
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const html = await request(id);
const $ = load(html);
const audio = $("body audio[src*=http]");
const audioUrl = audio[0].attribs.src;
// console.debug('世纪DJ音乐网 audioUrl =====>' + audioUrl); // js_debug.log
return JSON.stringify({
parse: 0,
url: audioUrl,
});
}
async function search(wd, quick, pg) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
const link = HOST + "/index.php/dance/so/key?key=" + wd + "&cid=0&p=" + pg;
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font:first")[0];
return {
vod_id: a.attribs.href,
vod_name: tt.children[0].data,
vod_pic: img.attribs["src"],
vod_remarks: "🎵" + remarks.children[0].data || "",
};
});
const hasMore = $("ul.page_link > li > a:contains(\u00a0)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 60,
total: 60 * pgCount,
list: videos,
land: 1,
ratio: 1.78,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

1
cat/ali.js Normal file
View File

@ -0,0 +1 @@
(function(c,d){const n=b,e=c();while(!![]){try{const f=-parseInt(n(0x148))/0x1+-parseInt(n(0x140))/0x2*(parseInt(n(0x145))/0x3)+parseInt(n(0x150))/0x4*(parseInt(n(0x14c))/0x5)+-parseInt(n(0x147))/0x6+-parseInt(n(0x13d))/0x7+parseInt(n(0x13c))/0x8+parseInt(n(0x13b))/0x9*(parseInt(n(0x142))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xaf4a3));import{_}from'./cat.js';import{log}from'./utils.js';import{initSome,setToken,setShareId,getVod,playerContent,playerContentByFlag}from'./ali_api.js';function a(){const r=['126jHersJ','8018976SyNpYU','7198947GYbEkJ','wGsFx','isEmpty','50HOYYaa','PIvCN','1745270xSfZmS','match','split','68196ySTEaL','trim','3359892YLzwvG','845051dhMcfo','ali\x20init:','MlDBF','xvRmD','4405TqvVPk','stringify','HyWVX','ali\x20init\x20ext:','1244NAvJeB','ewEMb'];a=function(){return r;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x13a;let h=e[f];return h;},b(c,d);}async function initAli(c){const o=b,d={'HyWVX':function(f,g){return f(g);},'PIvCN':o(0x149),'ewEMb':function(f,g){return f+g;},'xvRmD':o(0x14f)};let e=c['ext'];await d[o(0x14e)](log,d[o(0x141)]+typeof c),await initSome(),await d[o(0x14e)](setToken,e),await d[o(0x14e)](log,d[o(0x13a)](d[o(0x14b)],e));}async function detailContent(c){const p=b,d={'MlDBF':function(l,m){return l(m);}},e=/www.aliyundrive.com\/s\/([^\/]+)(\/folder\/([^\/]+))?/;let f=c[p(0x146)](),g=f[p(0x143)](e);if(_[p(0x13f)](g))return'';let h=g[0x1],i=g['length']==0x3?g[0x3]:'';await d[p(0x14a)](setShareId,h);let j=await getVod(f,i),k=JSON[p(0x14d)]({'list':[j]});return k;}async function playContent(c,d,e){const q=b,f={'wGsFx':function(i,j){return i==j;},'rAcPj':function(i,j,k){return i(j,k);}};let g=d[q(0x144)]('+'),h=f[q(0x13e)](c,'原画')?await playerContent(g):await f['rAcPj'](playerContentByFlag,g,c);return h;}export{initAli,detailContent,playContent};

1
cat/alist_open.js Normal file

File diff suppressed because one or more lines are too long

8
cat/app.js Normal file
View File

@ -0,0 +1,8 @@
function __jsEvalReturn() {
return {
isVideoFormat: function (url) {
return !0;
},
};
}
export { __jsEvalReturn };

1
cat/bilibili.js Normal file
View File

@ -0,0 +1 @@
import{Crypto,load,_}from"assets://js/lib/cat.js";let key="bilibili",url="",siteKey="",siteType=0;const UA="Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",cookie={};async function request(reqUrl,referer,mth,data,hd){var headers={"User-Agent":UA,Cookie:_.map(cookie,(value,key)=>key+"="+value).join(";")},referer=(referer&&(headers.referer=encodeURIComponent(referer)),await req(reqUrl,{method:mth||"get",headers:headers,data:data,postType:"post"===mth?"form":""}));return referer.content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype,url=cfg.ext}async function home(filter){return(await request(url)).replaceAll("1$/$1","1$/$0")}async function homeVod(){return"{}"}async function category(tid,pg,filter,extend){pg<=0&&(pg=1);let api=url+"?t="+tid+"&pg="+pg;return extend&&(tid=Object.entries(extend).map(([key,val]=entry)=>"&"+key+"="+val),api=(api+=tid)+("&f="+encodeURIComponent(JSON.stringify(extend)))),request(api)}async function detail(id){return request(url+"?ids="+id)}async function play(flag,id,flags){return request(url.replace("/bilibili","/play")+"?bvid="+id+"&from=open")}async function search(wd,quick){return request(url+"?wd="+wd)}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};

136
cat/bookan_book_open.js Normal file
View File

@ -0,0 +1,136 @@
import { _ } from './lib/cat.js';
let key = 'bookan';
let url = 'https://api.bookan.com.cn';
let siteKey = '';
let siteType = 0;
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
return JSON.stringify({
class: [
{ type_id: '1305', type_name: '少年读物' },
{ type_id: '1304', type_name: '儿童文学' },
{ type_id: '1320', type_name: '国学经典' },
{ type_id: '1306', type_name: '文艺少年' },
{ type_id: '1309', type_name: '育儿心经' },
{ type_id: '1310', type_name: '心理哲学' },
{ type_id: '1307', type_name: '青春励志' },
{ type_id: '1312', type_name: '历史小说' },
{ type_id: '1303', type_name: '故事会' },
{ type_id: '1317', type_name: '音乐戏剧' },
{ type_id: '1319', type_name: '相声评书' },
],
});
}
async function category(tid, pg, filter, extend) {
pg = pg || 1;
if (pg == 0) pg = 1;
let content = await request(`${url}/voice/book/list?instance_id=25304&page=${pg}&category_id=${tid}&num=24`);
let data = JSON.parse(content).data;
let books = [];
for (const book of data.list) {
books.push({
book_id: book.id,
book_name: book.name,
book_pic: book.cover,
book_remarks: book.extra.author,
});
}
return JSON.stringify({
page: data.current_page,
pagecount: data.last_page,
limit: 24,
total: data.total,
list: books,
});
}
async function detail(id) {
let content = await request(`${url}/voice/album/units?album_id=${id}&page=1&num=200&order=1`);
let data = JSON.parse(content).data;
let book = {
book_id: id,
type_name: '',
book_year: '',
book_area: '',
book_remarks: '',
book_actor: '',
book_director: '',
book_content: '',
};
let us = _.map(data.list, function (b) {
return formatPlayUrl(b.title) + '$' + b.file;
}).join('#');
book.volumes = '书卷';
book.urls = us;
return JSON.stringify({
list: [book],
});
}
function formatPlayUrl(name) {
return name
.trim()
.replace(/<|>|《|》/g, '')
.replace(/\$|#/g, ' ')
.trim();
}
async function proxy(segments, headers) {}
async function play(flag, id, flags) {
return JSON.stringify({
parse: 0,
url: id,
});
}
async function search(wd, quick, pg) {
pg = pg || 1;
if (pg == 0) pg = 1;
let content = await request(`https://es.bookan.com.cn/api/v3/voice/book?instanceId=25304&keyword=${wd}&pageNum=${pg}&limitNum=20`);
let data = JSON.parse(content).data;
let books = [];
for (const book of data.list) {
books.push({
book_id: book.id,
book_name: book.name,
book_pic: book.cover,
book_remarks: book.extra.author,
});
}
return JSON.stringify({
page: data.current_page,
pagecount: data.last_page,
limit: 20,
total: data.total,
list: books,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
category: category,
detail: detail,
play: play,
search: search,
};
}

190
cat/boosj_open.js Normal file
View File

@ -0,0 +1,190 @@
import { load, _ } from './lib/cat.js';
let key = '童趣';
let HOST = 'https://www.boosj.com';
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 request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || MOBILE_UA,
'Referer': HOST
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const classes = [{ type_id: '', type_name: '全部' }, { type_id: 28, type_name: '辅食' }, { type_id: 582, type_name: '动画' }, { type_id: 3364, type_name: '儿童舞蹈' }, { type_id: 3366, type_name: '少儿英语' }, { type_id: 3367, type_name: '儿童歌曲' }, { type_id: 3622, type_name: '才艺' }, { type_id: 3782, type_name: '播视自制' }, { type_id: 3822, type_name: '故事' }, { type_id: 3842, type_name: '亲子教育' }, { type_id: 4402, type_name: '美术' }, { type_id: 4583, type_name: '其他' }, { type_id: 4762, type_name: '儿童游戏' }, { type_id: 4842, type_name: '识物' }, { type_id: 4843, type_name: '绘本' }, { type_id: 4844, type_name: '古诗' }, { type_id: 4845, type_name: '科普' }, { type_id: 5102, type_name: '儿童玩具' }, { type_id: 5142, type_name: '播视童趣儿童玩具' }];
const filterObj = {};
const jsonData = [
{
key: 'age',
name: '年龄段',
value: [
{ n: '全部', v: '' },
{ n: '6岁以上', v: '?p367=370' },
{ n: '3~6岁', v: '?p367=369' },
{ n: '0~3岁', v: '?p367=368' },
],
init: '',
},
{
key: 'by',
name: '排序',
value: [
{ n: '全部', v: '' },
{ n: '最新发布', v: 'lately' },
{ n: '最多播放', v: 'pop' },
{ n: '最多评论', v: 'view' },
],
init: '',
},
];
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
filterObj[cls.type_id] = jsonData;
return cls;
}),
filters: filterObj,
});
}
async function homeVod() {
const link = HOST + '/search_res_3362__3364_1_.html';
const html = await request(link);
const $ = load(html);
const items = $('body div.bj-col4:has(h3)');
let videos = _.map(items, (it) => {
const a = $(it).find('a:first')[0];
const img = $(it).find('img:first')[0];
const remarks = $(it).find('span.played')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: remarks.children[0].data || '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof (pg) == 'undefined') pg = 1;
const link = HOST + '/search_res_3362__' + tid + '_' + pg + '_' + (extend.by || '') + '.html' + (extend.age || '');
const html = await request(link);
const $ = load(html);
const items = $('body div.bj-col4:has(h3)');
let videos = _.map(items, (it) => {
const a = $(it).find('a:first')[0];
const img = $(it).find('img:first')[0];
const remarks = $(it).find('span.played')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: remarks.children[0].data || '',
};
});
const hasMore = $('div.pub_paging > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 30,
total: 30 * pgCount,
list: videos,
});
}
async function detail(id) {
const vod = {
vod_id: id,
vod_remarks: "",
};
const playlist = ["点击播放" + "$" + vod.vod_id];
vod.vod_play_from = "道长在线";
vod.vod_play_url = playlist.join("#");
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const body = JSON.parse(await request('https://gslb.boosj.com/ipv2.json'));
body._id = id.match(/\d+/)[0];
const json = JSON.parse(await request(buildUrl(body.gslb, body)));
const purl = json.url + '?' + json.t
// console.debug('童趣purl =====>' + purl); // js_debug.log
let headers = {
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9; 22081212C Build/PQ3B.190801.002)',
};
return JSON.stringify({
parse: 0,
url: purl,
header: headers,
});
}
async function search(wd, quick) {
var data = JSON.parse(await request('https://search.boosj.com/m_ajax?q=' + wd + '&p=' + pg + '&typeId=3362')).body;
let videos = _.map(data.result, (it) => {
return {
vod_id: it.playUrl,
vod_name: it.resourceName,
vod_pic: it.imageUrl,
vod_remarks: it.clickNumStr || '',
}
});
return JSON.stringify({
page: parseInt(pg),
pagecount: data.pageCount,
limit: 30,
total: data.rowCount,
list: videos,
});
}
function buildUrl(url, obj) {
obj = obj || {};
if (url.indexOf('?') < 0) {
url += '?'
}
let param_list = [];
let keys = Object.keys(obj);
keys.forEach(it => {
param_list.push(it + '=' + obj[it])
});
let prs = param_list.join('&');
if (keys.length > 0 && !url.endsWith('?')) {
url += '&'
}
url += prs;
return url
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

1
cat/bulei_open.js Normal file

File diff suppressed because one or more lines are too long

1
cat/caiji.js Normal file
View File

@ -0,0 +1 @@
//bbQ0FUT1BNEGNhaWppLmpzLGFzc2V0czovL2pzL2xpYi9jYXQuanMcX19qc0V2YWxSZXR1cm4CXw5zaXRlS2V5EHNpdGVUeXBlBFVBDmJhc2VVcmwUY2F0ZWdvcmllcwhpbml0EmdldEhlYWRlchJnZXRTdHJpbmcIaG9tZQ5ob21lVm9kEGNhdGVnb3J5DGRldGFpbAhwbGF5DHNlYXJjaN4BTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEwOS4wLjAuMCBTYWZhcmkvNTM3LjM2BmNmZwhza2V5CnN0eXBlBmV4dAZ1cmwMaGVhZGVyFFVzZXItQWdlbnQGcmVzBnJlcQ5oZWFkZXJzDmNvbnRlbnQMZmlsdGVyDHJlcVVybA5qc29uU3RyCGRhdGEWY2xhc3Nlc3NBcnIOY2xhc3NlcxJmaWx0ZXJPYmoGb25lCnBhcnNlDmlzRW1wdHkQaW5jbHVkZXMSdHlwZV9uYW1lCHB1c2gOdHlwZV9pZBJzdHJpbmdpZnkOZmlsdGVycwR7fQZ0aWQEcGcMZXh0ZW5kDHZpZGVvcyA/YWM9dmlkZW9saXN0JnQ9CCZwZz0IbGlzdAx2b2RfaWQQdm9kX25hbWUOdm9kX3BpYxZ2b2RfcmVtYXJrcxBwYXJzZUludAhwYWdlEnBhZ2Vjb3VudApsaW1pdAp0b3RhbARpZAZ2b2QkP2FjPXZpZGVvbGlzdCZpZHM9EHZvZF95ZWFyEHZvZF9hcmVhEnZvZF9hY3Rvchh2b2RfZGlyZWN0b3IWdm9kX2NvbnRlbnQadm9kX3BsYXlfZnJvbRh2b2RfcGxheV91cmwIZmxhZwR3ZApxdWljaxw/YWM9ZGV0YWlsJndkPQ+kAwGmAwEAD6gDAAEAqgMADgAGAaABAAAAARAKSwCqAwAMrAMACa4DAQmwAwIJsgMDCbQDBAm2AwUBuAMGAboDBwG8AwgBvgMJAcADCgHCAwsBxAMMAcYDDQGoAw4BCOg0vgBfBgC+AV8HAL4CXwgAvgNfCQC+BF8KAL4FXwsAvgZfDAC+B18NAL4IXw4AvglfDwApv+Cz4QTkAAAA4r9fBAAmAABfBQAppAMBDAEANgYNDSEXAAaoAg5iBgG2AwEAAQIEAGMBygMAAQCsAwEIrgMCCLIDBAi0AwUIz0HmAAAAEWYAAA7PQecAAAARZgEADs9B6AAAAJcESAAAAKnoDs9B6AAAABFmAgAO6jDPQegAAACXBEkAAACp6CHPQegAAABB6QAAABFmAgAOz0HoAAAAQdoAAAARZgMADgYupAMJCAM6Ok46WFNUDkMGAbgDAAEAAwEAFgHUAwEAILADAwhhAAALx2IAAATrAAAAcWUAAEliAAAopAMUAxINRA5iBgG6AwEBAQQBAB0C0gMAAQDYAwEAILgDBwBhAAA47QAAAM8L2+xM7gAAAO6Lx2IAAEHvAAAALqQDGgQSJiYSDmIGAbwDAQcBBwQA5QEI4AMAAQDiAwEAMOQDAQEw5gMBAjDoAwEDMOoDAQQg7AMBBSDuAwIGILIDBAi6AwgAqgMADLQDBQhhBQBhBABhAwBhAgBhAQBhAABlAADH3GIAAO2LyDiYAAAAQvgAAABiAQAkAQDJYgIAQR4AAADKJgAAwQQLwQVhBgBiAwB96nnBBmUCAEL5AAAAZQMAJAEAlug/ZQMAQvoAAABiBgBB+wAAACQBAOhRYgQAQvwAAAALYgYAQf0AAABM/QAAAGIGAEH7AAAATPsAAAAkAQAO6ihiBABC/AAAAAtiBgBB/QAAAEz9AAAAYgYAQfsAAABM+wAAACQBAA6AAOiFDoM4mAAAAEL+AAAAC2IEAEweAAAAYgUATP8AAAAkAQAupAMiEV0XJlgwHBI6WGzHDcchOisrDmIGAb4DAAAAAQAABgAEAAEAAC6kAzgBAw5iBgHAAwQFBAcCAPUBCYIEAAEAhAQAAQDgAwABAIYEAAEA4gMBADDkAwEBMOYDAQIwiAQBAyDuAwMEILIDBAi6AwgAYQMAYQIAYQEAYQAA0DhFAAAAqRHpBQ7Qs6ToA7TUZQAABAUBAACdz50EBgEAAJ3QncfcYgAA7YvIOJgAAABC+AAAAGIBACQBAMkmAADKYQQAYgIAQQcBAAB96kTBBGIDAEL8AAAAC2IEAEEIAQAATAgBAABiBABBCQEAAEwJAQAAYgQAQQoBAABMCgEAAGIEAEELAQAATAsBAAAkAQAOgADoug6DOJgAAABC/gAAAAs4DAEAANDtTA0BAABiAgBBDgEAAEwOAQAAOAwBAABiAgBBDwEAAO1MDwEAAGICAEEQAQAATBABAABiAwBMBwEAACQBAC6kAz0UP11nJlgXUzBEREREFyM6P0RiRCsOYgYBwgMBBQEEAwCcAgaiBAABAOIDAQAw5AMBATDmAwECMO4DAQMwpAQBBCCyAwQIugMIAKoDAAxhBABhAwBhAgBhAQBhAABlAAAEEwEAAJ3PncfcYgAA7YvIOJgAAABC+AAAAGIBACQBAMliAgBBBwEAALNHymUCAEL5AAAAYgMAJAEA6AcEAAEAAC4LYgMAQQgBAABMCAEAAGIDAEEJAQAATAkBAABiAwBB+wAAAEz7AAAAYgMAQQoBAABMCgEAAGIDAEEUAQAATBQBAABiAwBBFQEAAEwVAQAAYgMAQRYBAAAR6QMOv0wWAQAAYgMAQRcBAAAR6QMOv0wXAQAAYgMAQQsBAAAR6QMOv0wLAQAAYgMAQRgBAABMGAEAAGIDAEEZAQAATBkBAABiAwBBGgEAAEwaAQAAwQQ4mAAAAEL+AAAAC2IEACYBAEwHAQAAJAEALqQDVhhOPyZYOlMcCAhERERERERdXV1EREQOOjoOYgYBxAMDAAMEAAAbA7YEAAEAogQAAQDaAQABADiYAAAAQv4AAAALs0z4AAAA0EzpAAAAJAEALqQDcwQDOiEhDmIGAcYDAwUDBwIA3AEIuAQAAQC6BAABAIQEAAEA4gMBADDkAwEBMOYDAQIwiAQBAyCkBAMEMLIDBAi6AwgAYQMAYQIAYQEAYQAA0ThFAAAAqRHpBQ7Rs6ToA7TVZQAABB4BAACdz50EBgEAAJ3RncfcYgAA7YvIOJgAAABC+AAAAGIBACQBAMkmAADKYQQAYgIAQQcBAAB96kTBBGIDAEL8AAAAC2IEAEEIAQAATAgBAABiBABBCQEAAEwJAQAAYgQAQQoBAABMCgEAAGIEAEELAQAATAsBAAAkAQAOgADoug6DOJgAAABC/gAAAAs4DAEAAGICAEENAQAA7UwNAQAAYgIAQQ4BAABMDgEAAGIDAEwHAQAAJAEALqQDexI/XWcmWBdTMEREREQXIjpiRCsOQwYBqAMAAAACBwAyALYDBgC8AwkAvgMKAMADCwDCAwwAxAMNAMYDDgAL20zbAAAA3EzeAAAA3UzfAAAA3kzgAAAAXgQATOEAAABeBQBM4gAAAF4GAEzjAAAAKKQDkQEJAwghISEhKysr

109
cat/cntv_open.js Normal file
View File

@ -0,0 +1,109 @@
// 无搜索功能
import { _ } from './lib/cat.js';
let key = '视聚场';
let HOST = 'http://api.cntv.cn';
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 request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || MOBILE_UA,
},
});
return res.content
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype
}
async function home(filter) {
const classes = [{ type_id: "TOPC1451528971114112", type_name: "新闻联播" }, { type_id: "TOPC1451558976694518", type_name: "焦点访谈" }, { type_id: "TOPC1451464665008914", type_name: "今日说法" }, { type_id: "TOPC1451378757637200", type_name: "等着我" }, { type_id: "TOPC1451559129520755", type_name: "新闻直播间" }, { type_id: "TOPC1451540328102649", type_name: "海峡两岸" }, { type_id: "TOPC1451530382483536", type_name: "天网" }, { type_id: "TOPC1451540389082713", type_name: "今日关注" }, { type_id: "TOPC1451557893544236", type_name: "探索·发现" }, { type_id: "TOPC1665739007799851", type_name: "高端访谈" }, { type_id: "TOPC1451557052519584", type_name: "百家讲坛" }, { type_id: "TOPC1451464884159276", type_name: "开讲啦" }, { type_id: "TOPC1451464884159276", type_name: "故事里的中国" }, { type_id: "TOPC1514182710380601", type_name: "对话" }, { type_id: "TOPC1451559038345600", type_name: "面对面" }, { type_id: "TOPC1451378967257534", type_name: "动物世界" }, { type_id: "TOPC1451558190239536", type_name: "走进科学" }, { type_id: "TOPC1451525103989666", type_name: "人与自然" }, { type_id: "TOPC1451557421544786", type_name: "地理·中国" }, { type_id: "TOPC1451541349400938", type_name: "远方的家" }, { type_id: "TOPC1451558150787467", type_name: "自然传奇" }, { type_id: "TOPC1451534366388377", type_name: "是真的吗" }, { type_id: "TOPC1451467630488780", type_name: "星光大道" }, { type_id: "TOPC1451557646802924", type_name: "健康之路" }, { type_id: "TOPC1451559025546574", type_name: "动画大放映" }, { type_id: "TOPC1451378857272262", type_name: "第一动画乐园" }, { type_id: "TOPC1451541414450906", type_name: "精彩音乐汇" }, { type_id: "TOPC1451534421925242", type_name: "音乐厅" }, { type_id: "TOPC1451541994820527", type_name: "民歌·中国" }, { type_id: "TOPC1575253587571324", type_name: "跟着书本去旅行" }, { type_id: "TOPC1451354597100320", type_name: "中国电影报道" }, { type_id: "TOPC1451469943519994", type_name: "星推荐" }, { type_id: "TOPC1571217727564820", type_name: "方圆剧阵" }, { type_id: "TOPC1451558856402351", type_name: "空中剧院" }, { type_id: "TOPC1650782829200997", type_name: "正大综艺" }, { type_id: "TOPC1451550970356385", type_name: "体坛快讯" }, { type_id: "TOPC1451530259915198", type_name: "第一时间" }, { type_id: "TOPC1451465894294259", type_name: "开门大吉" }, { type_id: "TOPC1451464884159276", type_name: "开讲啦" }, { type_id: "TOPC1451558858788377", type_name: "共同关注" }, { type_id: "TOPC1451527941788652", type_name: "军事报道" }, { type_id: "TOPC1451558819463311", type_name: "新闻调查" }, { type_id: "TOPC1451559097947700", type_name: "新闻30分" }, { type_id: "TOPC1451559066181661", type_name: "新闻1+1" }, { type_id: "TOPC1451540448405749", type_name: "今日亚洲" }, { type_id: "TOPC1451559129520755", type_name: "新闻直播间" }, { type_id: "TOPC1451558428005729", type_name: "24小时" }, { type_id: "TOPC1451539894330405", type_name: "中国新闻" }, { type_id: "TOPC1451558779639282", type_name: "午夜新闻" }, { type_id: "TOPC1451558496100826", type_name: "朝闻天下" }, { type_id: "TOPC1451528792881669", type_name: "晚间新闻" }, { type_id: "TOPC1451559180488841", type_name: "新闻周刊" }, { type_id: "TOPC1601362002656197", type_name: "经济半小时" }, { type_id: "TOPC1451533652476962", type_name: "经济大讲堂" }, { type_id: "TOPC1453100395512779", type_name: "正点财经" }, { type_id: "TOPC1451546588784893", type_name: "生活圈" }, { type_id: "TOPC1451526037568184", type_name: "生活提示" }, { type_id: "TOPC1451558532019883", type_name: "东方时空" }, { type_id: "TOPC1451533782742171", type_name: "经济信息联播" }, { type_id: "TOPC1571034705435323", type_name: "今日环球" }, { type_id: "TOPC1451543462858283", type_name: "一线" }];
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 + '/NewVideo/getVideoListByColumn?id=TOPC1451558856402351&n=10&sort=desc&p=1&mode=0&serviceId=tvcctv'));
let videos = _.map(data.data.list, (it) => {
return {
vod_id: it.guid,
vod_name: it.title,
vod_pic: it.image,
vod_remarks: it.time || '',
}
});
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 + '/NewVideo/getVideoListByColumn?id=' + tid + '&n=10&sort=desc&p=' + pg + '&mode=0&serviceId=tvcctv'));
let videos = _.map(data.data.list, (it) => {
return {
vod_id: it.guid,
vod_name: it.title,
vod_pic: it.image,
vod_remarks: it.time || '',
}
});
const pgChk = JSON.parse(await request(HOST + '/NewVideo/getVideoListByColumn?id=' + tid + '&n=10&sort=desc&p=' + (parseInt(pg) + 1) + '&mode=0&serviceId=tvcctv')).data.list;
const pgCount = pgChk.length > 0 ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: parseInt(pgCount),
limit: 10,
total: parseInt(data.total),
list: videos,
})
}
async function detail(id) {
const vod = {
vod_id: id,
vod_remarks: '',
};
const playlist = ['点击播放' + '$' + 'https://hls.cntv.myhwcdn.cn/asp/hls/2000/0303000a/3/default/' + id + '/2000.m3u8'];
vod.vod_play_from = key;
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
// console.debug('视聚场 id =====>' + id); // js_debug.log
return JSON.stringify({
parse: 0,
url: id,
})
}
async function search(wd, quick, pg) {
return '{}'
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
}
}

View File

@ -2,7 +2,7 @@
import { Crypto, load, _ } from './lib/cat.js';
let key = 'czzy';
let host = 'https://www.cz01.vip/'; // 厂长地址发布页
let host = 'https://www.czzy.site'; // 厂长地址发布页
// let url = 'https://cz01.cc';
let url = '';
let siteKey = '';

162
cat/dj0898_book_open.js Normal file
View File

@ -0,0 +1,162 @@
import { load, _ } from "./lib/cat.js";
let key = "世纪DJ音乐网_book";
let HOST = "http://m.dj0898.com";
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 request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: "get",
headers: {
"User-Agent": agentSp || MOBILE_UA,
Referer: HOST,
},
});
return res.content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const classes = [{ type_id: 1, type_name: "🎧串烧舞曲" }, { type_id: 2, type_name: "🎧外文舞曲" }, { type_id: 3, type_name: "🎧早场暖场" }, { type_id: 4, type_name: "🎧中文舞曲" }, { type_id: 5, type_name: "🎧其他舞曲" }, { type_id: 6, type_name: "🎧国外电音" }, { type_id: 8, type_name: "🎧慢歌连版" }, { type_id: 9, type_name: "🎧酒吧潮歌" }, { type_id: 10, type_name: "🎧中文串烧" }, { type_id: 11, type_name: "🎧外文串烧" }, { type_id: 12, type_name: "🎧中外串烧" }, { type_id: 13, type_name: "🎧车载串烧" }, { type_id: 14, type_name: "🎧越鼓串烧" }, { type_id: 40, type_name: "🎧3D/环绕" }, { type_id: 45, type_name: "🎧口水旋律" }, { type_id: 46, type_name: "🎧精品收藏" }, { type_id: 47, type_name: "🎧开场舞曲" }, { type_id: 48, type_name: "🎧印度舞曲" }, { type_id: 49, type_name: "🎧编排套曲" }, { type_id: 20, type_name: "🎧DuTch" }, { type_id: 21, type_name: "🎧Mash up" }, { type_id: 22, type_name: "🎧ClubHouse" }, { type_id: 23, type_name: "🎧ElectroHouse" }, { type_id: 24, type_name: "🎧越南鼓Dj" }, { type_id: 30, type_name: "🎧Funky" }, { type_id: 31, type_name: "🎧Reggae" }, { type_id: 32, type_name: "🎧Rnb" }, { type_id: 33, type_name: "🎧Hip Hop" }, { type_id: 34, type_name: "🎧Dubstep" }, { type_id: 8017, type_name: "🎧Hardstyle" }, { type_id: 8018, type_name: "🎧Hands Up" }];
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
return cls;
}),
filters: filterObj,
});
}
async function homeVod() {
const link = HOST + "/dance/lists/id/10/1";
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font")[5];
return {
vod_id: a.attribs.href,
vod_name: tt.children[0].data,
vod_pic: img.attribs["src"],
vod_remarks: "🎵" + remarks.children[0].data || "",
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
const link = HOST + "/dance/lists/id/" + tid + "/" + pg;
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font")[5];
return {
book_id: a.attribs.href,
book_name: tt.children[0].data,
book_pic: img.attribs["src"],
book_remarks: "🎵" + remarks.children[0].data || "",
};
});
const hasMore = $("ul.page_link > li > a:contains(\u00a0)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 60,
total: 60 * pgCount,
list: videos,
});
}
async function detail(id) {
const vod = {
book_id: id,
type_name: '',
book_year: '',
book_area: '',
book_remarks: '',
book_actor: '',
book_director: '',
book_content: '',
};
const playlist = ["点击播放" + "$" + vod.book_id];
vod.volumes = "道长在线";
vod.urls = playlist.join("#");
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const html = await request(id);
const $ = load(html);
const audio = $("body audio[src*=http]");
const audioUrl = audio[0].attribs.src;
// console.debug('世纪DJ音乐网 audioUrl =====>' + audioUrl); // js_debug.log
return JSON.stringify({
parse: 0,
url: audioUrl,
});
}
async function search(wd, quick, pg) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
const link = HOST + "/index.php/dance/so/key?key=" + wd + "&cid=0&p=" + pg;
const html = await request(link);
const $ = load(html);
const list = $("ul.djddv_djList > li");
let videos = _.map(list, (it) => {
const a = $(it).find("a")[1];
const img = $(it).find("img:first")[0];
const tt = $(it).find("strong:first")[0];
const remarks = $(it).find("font:first")[0];
return {
book_id: a.attribs.href,
book_name: tt.children[0].data,
book_pic: img.attribs["src"],
book_remarks: "🎵" + remarks.children[0].data || "",
};
});
const hasMore = $("ul.page_link > li > a:contains(\u00a0)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 60,
total: 60 * pgCount,
list: videos,
land: 1,
ratio: 1.78,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

166
cat/duboku2_open.js Normal file
View File

@ -0,0 +1,166 @@
import { Crypto, load, _, jinja2 } from './lib/cat.js';
let key = 'duboku';
let url = 'https://u.duboku.io';
let siteKey = '';
let siteType = 0;
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || UA,
'Referer': url
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const html = await request(url);
const $ = load(html);
const class_parse = $('ul.nav-list > li > a[href*=vodtype]');
let classes = [];
classes = _.map(class_parse, (cls) => {
let typeId = cls.attribs['href'];
typeId = typeId.substring(typeId.lastIndexOf('/') + 1).replace('.html','');
return {
type_id: typeId,
type_name: cls.children[0].data,
};
});
let filterObj = {
"2":[{"key":"cateId","name":"类型","value":[{"n":"全部","v":"2"},{"n":"陆剧","v":"13"},{"n":"日韩剧","v":"15"},{"n":"短剧","v":"21"},{"n":"台泰剧","v":"14"},{"n":"港剧","v":"20"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"美国","v":"美国"},{"n":"英国","v":"英国"},{"n":"巴西","v":"巴西"},{"n":"泰国","v":"泰国"},{"n":"法国","v":"法国"},{"n":"日本","v":"日本"},{"n":"荷兰","v":"荷兰"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"韩语","v":"韩语"},{"n":"泰语","v":"泰语"},{"n":"法语","v":"法语"},{"n":"日语","v":"日语"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"3":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"真人秀","v":"真人秀"},{"n":"选秀","v":"选秀"},{"n":"竞演","v":"竞演"},{"n":"情感","v":"情感"},{"n":"访谈","v":"访谈"},{"n":"播报","v":"播报"},{"n":"旅游","v":"旅游"},{"n":"音乐","v":"音乐"},{"n":"美食","v":"美食"},{"n":"纪实","v":"纪实"},{"n":"曲艺","v":"曲艺"},{"n":"生活","v":"生活"},{"n":"游戏互动","v":"游戏互动"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"韩国","v":"韩国"},{"n":"美国","v":"美国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"4":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"玄幻","v":"玄幻"},{"n":"武侠","v":"武侠"},{"n":"情感","v":"情感"},{"n":"科幻","v":"科幻"},{"n":"热血","v":"热血"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":"冒险"},{"n":"萝莉","v":"萝莉"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":"社会","v":"社会"},{"n":"亲子","v":"亲子"},{"n":"益智","v":"益智"},{"n":"励志","v":"励志"},{"n":"其他","v":"其他"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"国产","v":"国产"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"法国","v":"法国"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"13":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"15":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"21":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"14":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"台湾","v":"台湾"},{"n":"泰国","v":"泰国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
"20":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}]
};
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
const link = url + '/vodshow/2--hits---------.html';
const html = await request(link);
const $ = load(html);
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
vod_name: it.attribs.title,
vod_pic: it.attribs['data-original'],
vod_remarks: remarks || '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0) pg = 1;
const link = url + '/vodshow/' + (extend.CateId || tid) + '-'+(extend.area || '')+'-'+(extend.by || 'time')+'-'+(extend.class || '')+'-'+(extend.lang || '')+'-'+(extend.letter || '')+'---' + (`${pg}`) + '---'+(extend.year || '')+'.html';
const html = await request(link);
const $ = load(html);
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
vod_name: it.attribs.title,
vod_pic: it.attribs['data-original'],
vod_remarks: remarks || '',
};
});
const hasMore = $('ul.myui-page > li > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
async function detail(id) {
const html = await request(url + '/voddetail/' + id + '.html');
const $ = load(html);
let vod = {
vod_id: id,
vod_name: $('h1:first').text().trim(),
vod_type: $('.myui-content__detail p:first a').text(),
vod_actor: $('.myui-content__detail p:nth-child(5)').text().replace('主演:',''),
vod_director: $('.myui-content__detail p:nth-child(6)').text().replace('导演:',''),
vod_pic: $('div.myui-content__thumb img:first').attr('data-original'),
vod_remarks :$('#rating:first span').text().replace(/\s{2,}/g, ' '),
vod_content: $('span.data').text().trim(),
};
const playlist = _.map($('ul.sort-list > li > a'), (it) => {
return it.children[0].data + '$' + it.attribs.href.replace(/\/vodplay\/(.*).html/g, '$1');
});
vod.vod_play_from = key;
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const link = url + '/vodplay/' + id + '.html';
const html = await request(link);
const $ = load(html);
const js = JSON.parse($('script:contains(player_)').html().replace('var player_data=',''));
const playUrl = js.url.replace('index.m3u8','hls\/index.m3u8');
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
async function search(wd, quick) {
let data = JSON.parse(await request(url + '/index.php/ajax/suggest?mid=1&wd=' + wd)).list;
let videos = [];
for (const vod of data) {
videos.push({
vod_id: vod.id,
vod_name: vod.name,
vod_pic: vod.pic,
vod_remarks: '',
});
}
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

View File

@ -2,8 +2,8 @@
import { load, _ } from './lib/cat.js';
let key = 'duboku';
let HOST = 'https://www.duboku.tv';
// let HOST = 'https://u.duboku.io';
let HOST = 'https://u.duboku.io';
// let HOST = 'https://www.duboku.tv';
let siteKey = '';
let siteType = 0;

206
cat/jojo_open.js Normal file
View File

@ -0,0 +1,206 @@
import { Crypto, load, _, dayjs } from 'assets://js/lib/cat.js';
let key = 'jiohub';
let url = 'https://jiohub.top';
let siteKey = '';
let siteType = 0;
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
const cookie = {};
async function request(reqUrl, referer, mth, data, hd) {
const headers = {
'User-Agent': UA,
Cookie: _.map(cookie, (value, key) => {
return `${key}=${value}`;
}).join(';'),
};
if (referer) headers.referer = encodeURIComponent(referer);
let res = await req(reqUrl, {
method: mth || 'get',
headers: headers,
data: data,
postType: mth === 'post' ? 'form' : '',
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
const html = await request(url);
const $ = load(html);
const series = $('.nav-list a[href*=/video]');
let classes = _.map(series, (s) => {
let typeId = s.attribs['href'];
let typeName = typeId.match(/\/video\/(.*)\?/)[1];
typeName = decodeURIComponent(typeName);
return {
type_id: typeName,
type_name: typeName,
};
});
return JSON.stringify({
class: classes,
});
}
async function homeVod() {
return '{}';
}
async function category(tid, pg, filter, extend) {
let page = pg || 1;
if (page == 0) page = 1;
const link = url + '/video/' + tid + "?page=" + page + '&size=18';
const html = await request(link);
const $ = load(html);
const items = $('div.content-body > a');
let videos = _.map(items, (item) => {
const img = $(item).find('img:first')[0].attribs['src'];
const a = item.attribs['href'].match(/\/watch\/(.*)/)[1];
const n = ($(item).find('p.card-title')[0]).children[0].data;
let speed = ($(item).find('p.item-speed')[0]).children[0].data || '';
const score = ($(item).find('p.score')[0]).children[0].data || '';
if (speed == tid) speed = '';
return {
vod_id: a,
vod_name: n,
vod_pic: img,
vod_remarks: speed || score || '',
};
});
let total = 18;
const pag = $('ui-pagination');
if (pag.length > 0) {
try {
total = parseInt(pag[0].attribs['total']);
} catch (error) {
}
}
return JSON.stringify({
page: page,
pagecount: _.ceil(total / 18),
list: videos,
});
}
function stripHtmlTag(src) {
return src
.replace(/<\/?[^>]+(>|$)/g, '')
.replace(/&.{1,5};/g, '')
.replace(/\s{2,}/g, ' ');
}
async function detail(id) {
const html = await request(url + '/watch/' + id);
const $ = load(html);
const detail = $('div.content-detail > p');
let vod = {
vod_id: id,
vod_content: stripHtmlTag($('div.content-detail span.detail-sketch').html()).trim(),
};
for (const info of detail) {
const i = $(info).text().trim();
if (i.startsWith('地区:')) {
vod.vod_area = i.substring(3);
} else if (i.startsWith('年份:')) {
vod.vod_year = i.substring(3);
} else if (i.startsWith('类型:')) {
vod.vod_type = i.substring(3);
} else if (i.startsWith('导演:')) {
vod.vod_director = i.substring(3);
} else if (i.startsWith('主演:')) {
vod.vod_actor = i.substring(3);
} else if (i.startsWith('语言:')) {
vod.vod_lang = i.substring(3);
}
}
const urls = html.match(/let urls = \"(.*)\";/)[1].replace(/_/g, '/').replace(/-/g, '+');
var key = Crypto.enc.Utf8.parse("cf2d1a-6a4d-9ef8");
var playlist = Crypto.AES.decrypt(urls, key, { iv: key, padding: Crypto.pad.Pkcs7 });
playlist = Crypto.enc.Utf8.stringify(playlist).split('\n');
vod.vod_play_from = 'JOJO';
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
function playPid() {
var key = Crypto.enc.Utf8.parse("ba0-d4g5-45eb-c2ba0-d4g5-45eb-cs");
var iv = Crypto.enc.Hex.parse("00000000000000000000000000000000");
var pid = Crypto.AES.encrypt(dayjs().format('YYYY-MM-DD HH:mm'), key, { iv: iv, padding: Crypto.pad.Pkcs7 });
pid = pid.toString().replace(/\+/g, '-');
return pid;
}
async function play(flag, id, flags) {
return JSON.stringify({
parse: 0,
url: id + '?pid=' + playPid(),
header: {
'User-Agent': UA,
},
});
}
async function search(wd, quick, pg) {
let page = pg || 1;
if (page == 0) page = 1;
const link = url + '/video/search?q=' + wd + "&page=" + page + '&size=18&pid=' + playPid();
const html = await request(link);
const $ = load(html);
const items = $('div.content-body > a');
let videos = _.map(items, (item) => {
const img = $(item).find('img:first')[0].attribs['src'];
const a = item.attribs['href'].match(/\/watch\/(.*)/)[1];
const n = ($(item).find('p.card-title')[0]).children[0].data;
let speed = ($(item).find('p.item-speed')[0]).children[0].data || '';
const score = ($(item).find('p.score')[0]).children[0].data || '';
if (speed == '电影') speed = '';
return {
vod_id: a,
vod_name: n,
vod_pic: img,
vod_remarks: speed || score || '',
};
});
let total = 18;
const pag = $('ui-pagination');
if (pag.length > 0) {
try {
total = parseInt(pag[0].attribs['total']);
} catch (error) {
}
}
return JSON.stringify({
page: page,
pagecount: _.ceil(total / 18),
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

View File

@ -1,412 +1,412 @@
import { Crypto, dayjs, jinja2, _ } from './lib/cat.js';
let key = 'kkys';
let url = 'https://api1.baibaipei.com:8899';
let device = {};
let siteKey = '';
let siteType = 0;
async function request(reqUrl, postData, agentSp, get) {
let ts = dayjs().valueOf().toString();
let rand = randStr(32);
let sign = Crypto.MD5('abcdexxxdd2daklmn25129_' + ts + '_' + rand)
.toString()
.toLowerCase();
let headers = {
'user-agent': agentSp || device.ua,
};
if (reqUrl.includes('baibaipei')) {
headers['device-id'] = device.id;
headers['push-token'] = '';
headers['sign'] = sign;
headers['time'] = ts;
headers['md5'] = rand;
headers['version'] = '2.1.0';
headers['system-model'] = device.model;
headers['system-brand'] = device.brand;
headers['system-version'] = device.release;
}
let res = await req(reqUrl, {
method: get ? 'get' : 'post',
headers: headers,
data: postData || {},
postType: get ? '' : 'form',
});
let content = res.content;
// console.log(content);
return content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
var deviceKey = 'device';
var deviceInfo = await local.get(key, deviceKey);
if (deviceInfo.length > 0) {
try {
device = JSON.parse(deviceInfo);
} catch (error) {}
}
if (_.isEmpty(device)) {
device = randDevice();
device.id = randStr(33).toLowerCase();
device.ua = 'okhttp/3.12.0';
await local.set(key, deviceKey, JSON.stringify(device));
}
}
async function home(filter) {
// await req('https://www.facebook.com', {});
let data = JSON.parse(await request(url + '/api.php/Index/getTopVideoCategory')).data;
let classes = [];
let filterObj = {};
for (const type of data) {
let typeName = type.nav_name;
if (typeName == '推荐') continue;
let typeId = type.nav_type_id.toString();
classes.push({
type_id: typeId,
type_name: typeName,
});
if (!filter) continue;
try {
let filterAll = [];
let filterData = JSON.parse(await request(url + '/api.php/Video/getFilterType', { type: typeId })).data;
for (let key of Object.keys(filterData)) {
let itemValues = filterData[key];
if (key === 'plot') key = 'class';
let typeExtendName = '';
switch (key) {
case 'class':
typeExtendName = '类型';
break;
case 'area':
typeExtendName = '地区';
break;
case 'lang':
typeExtendName = '语言';
break;
case 'year':
typeExtendName = '年代';
break;
case 'sort':
typeExtendName = '排序';
break;
}
if (typeExtendName.length === 0) continue;
let newTypeExtend = {
key: key,
name: typeExtendName,
};
let newTypeExtendKV = [];
for (let j = 0; j < itemValues.length; j++) {
const name = itemValues[j];
let value = key === 'sort' ? j + '' : name === '全部' ? '0' : name;
newTypeExtendKV.push({ n: name, v: value });
}
newTypeExtend['init'] = key === 'sort' ? '1' : newTypeExtendKV[0]['v'];
newTypeExtend.value = newTypeExtendKV;
filterAll.push(newTypeExtend);
}
if (!_.isEmpty(filterAll)) {
filterObj[typeId] = filterAll;
}
} catch (e) {
console.log(e);
}
}
// console.log(await homeVod());
// console.log(classes);
// console.log(filterObj);
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
let jsonArray = JSON.parse(await request(url + '/api.php/Index/getHomePage', { type: 1, p: 1 })).data.video;
let videos = [];
for (const item of jsonArray) {
if (item.title.styleType !== 0) continue;
for (const vObj of item.list) {
videos.push({
vod_id: vObj.vod_id,
vod_name: vObj.vod_name,
vod_pic: vObj.vod_pic,
vod_remarks: vObj.vod_remarks || vObj.vod_score || '',
});
}
}
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg == 0) pg = 1;
let reqUrl = url + '/api.php/Video/getFilterVideoList';
var formData = JSON.parse(
jinja2(
`{
"type": "{{tid}}",
"p": "{{pg}}",
"area": "{{ext.area|default(0)}}",
"year": "{{ext.year|default(0)}}",
"sort": "{{ext.sort|default(0)}}",
"class": "{{ext.class|default(0)}}"
}`,
{ ext: extend, tid: tid, pg: pg }
)
);
console.log(formData);
let data = JSON.parse(await request(reqUrl, formData)).data;
let videos = [];
for (const vod of data.data) {
videos.push({
vod_id: vod.vod_id,
vod_name: vod.vod_name,
vod_pic: vod.vod_pic,
vod_remarks: vod.vod_remarks || vod.vod_score || '',
});
}
return JSON.stringify({
page: parseInt(data.current_page),
pagecount: parseInt(data.last_page),
limit: parseInt(data.per_page),
total: parseInt(data.total),
list: videos,
});
}
async function detail(id) {
let data = JSON.parse(await request(url + '/api.php/Video/getVideoInfo', { video_id: id })).data.video;
let vod = {
vod_id: data.vod_id,
vod_name: data.vod_name,
vod_pic: data.vod_pic,
type_name: data.vod_class,
vod_year: data.vod_year,
vod_area: data.vod_area,
vod_remarks: data.vod_remarks || '',
vod_actor: data.vod_actor,
vod_director: data.vod_director,
vod_content: data.vod_content.trim(),
};
let playlist = {};
for (const item of data.vod_play) {
let from = item.playerForm;
if (from === 'jp') continue;
if (from === 'xg') continue;
let urls = [];
for (const u of item.url) {
urls.push(formatPlayUrl(vod.vod_name, u.title) + '$' + u.play_url);
}
if (!playlist.hasOwnProperty(from) && urls.length > 0) {
playlist[from] = urls;
}
}
parse = data.parse || [];
vod.vod_play_from = _.keys(playlist).join('$$$');
let urls = _.values(playlist);
let vod_play_url = [];
for (const urlist of urls) {
vod_play_url.push(urlist.join('#'));
}
vod.vod_play_url = vod_play_url.join('$$$');
return JSON.stringify({
list: [vod],
});
}
var parse = [];
async function play(flag, id, flags) {
try {
if (id.indexOf('youku') >= 0 || id.indexOf('iqiyi') >= 0 || id.indexOf('v.qq.com') >= 0 || id.indexOf('pptv') >= 0 || id.indexOf('le.com') >= 0 || id.indexOf('1905.com') >= 0 || id.indexOf('mgtv') >= 0) {
if (parse.length > 0) {
for (let index = 0; index < parse.length; index++) {
try {
const p = parse[index];
let res = await req(p + id, {
headers: { 'user-agent': 'okhttp/4.1.0' },
});
var result = jsonParse(id, JSON.parse(res.content));
if (result.url) {
result.parse = 0;
return JSON.stringify(result);
}
} catch (error) {}
}
}
}
if (id.indexOf('jqq-') >= 0) {
var jqqHeader = await request(url + '/jqqheader.json', null, null, true);
var jqqHeaders = JSON.parse(jqqHeader);
var ids = id.split('-');
var jxJqq = await req('https://api.juquanquanapp.com/app/drama/detail?dramaId=' + ids[1] + '&episodeSid=' + ids[2] + '&quality=LD', { headers: jqqHeaders });
var jqqInfo = JSON.parse(jxJqq.content);
if (jqqInfo.data.playInfo.url) {
return JSON.stringify({
parse: 0,
playUrl: '',
url: jqqInfo.data.playInfo.url,
});
}
}
let res = await request(url + '/video.php', { url: id });
var result = jsonParse(id, JSON.parse(res).data);
if (result.url) {
result.parse = 0;
// demo of block hls ads
if (/vip\.lz|hd\.lz/.test(result.url)) {
result.url = await js2Proxy(true, siteType, siteKey, 'lzm3u8/' + base64Encode(result.url), {});
}
return JSON.stringify(result);
}
return JSON.stringify({
parse: 0,
playUrl: '',
url: id,
});
} catch (e) {
console.log(e);
return JSON.stringify({
parse: 0,
url: id,
});
}
}
async function proxy(segments, headers) {
let what = segments[0];
let url = base64Decode(segments[1]);
if (what == 'lzm3u8') {
const resp = await req(url, {});
let hls = resp.content;
const jsBase = await js2Proxy(false, siteType, siteKey, 'lzm3u8/', {});
const baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
console.log(hls.length);
hls = hls.replace(/#EXT-X-DISCONTINUITY\r*\n*#EXTINF:6.433333,[\s\S]*?#EXT-X-DISCONTINUITY/, '');
console.log(hls.length);
hls = hls.replace(/(#EXT-X-KEY\S+URI=")(\S+)("\S+)/g, function (match, p1, p2, p3) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + up + p3;
});
hls = hls.replace(/(#EXT-X-STREAM-INF:.*\n)(.*)/g, function (match, p1, p2) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + jsBase + base64Encode(up);
});
hls = hls.replace(/(#EXTINF:.*\n)(.*)/g, function (match, p1, p2) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + up;
});
return JSON.stringify({
code: resp.code,
content: hls,
headers: resp.headers,
});
}
return JSON.stringify({
code: 500,
content: '',
});
}
async function search(wd, quick) {
let data = JSON.parse(await request(url + '/api.php/Search/getSearch', { key: wd, type_id: 0, p: 1 })).data;
let videos = [];
for (const vod of data.data) {
videos.push({
vod_id: vod.vod_id,
vod_name: vod.vod_name,
vod_pic: vod.vod_pic,
vod_remarks: vod.vod_remarks || vod.vod_score || '',
});
}
return JSON.stringify({
list: videos,
});
}
function base64Encode(text) {
return Crypto.enc.Base64.stringify(Crypto.enc.Utf8.parse(text));
}
function base64Decode(text) {
return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
}
const charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
function randStr(len, withNum) {
var _str = '';
let containsNum = withNum === undefined ? true : withNum;
for (var i = 0; i < len; i++) {
let idx = _.random(0, containsNum ? charStr.length - 1 : charStr.length - 11);
_str += charStr[idx];
}
return _str;
}
function randDevice() {
return {
brand: 'Huawei',
model: 'HUAWEI Mate 20',
release: '10',
buildId: randStr(3, false).toUpperCase() + _.random(11, 99) + randStr(1, false).toUpperCase(),
};
}
function formatPlayUrl(src, name) {
return name
.trim()
.replaceAll(src, '')
.replace(/<|>|《|》/g, '')
.replace(/\$|#/g, ' ')
.trim();
}
function jsonParse(input, json) {
try {
let url = json.url ?? '';
if (url.startsWith('//')) {
url = 'https:' + url;
}
if (!url.startsWith('http')) {
return {};
}
let headers = json['headers'] || {};
let ua = (json['user-agent'] || '').trim();
if (ua.length > 0) {
headers['User-Agent'] = ua;
}
let referer = (json['referer'] || '').trim();
if (referer.length > 0) {
headers['Referer'] = referer;
}
_.keys(headers).forEach((hk) => {
if (!headers[hk]) delete headers[hk];
});
return {
header: headers,
url: url,
};
} catch (error) {
console.log(error);
}
return {};
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
proxy: proxy,
search: search,
};
import { Crypto, dayjs, jinja2, _ } from './lib/cat.js';
let key = 'kkys';
let url = 'https://api1.baibaipei.com:8899';
let device = {};
let siteKey = '';
let siteType = 0;
async function request(reqUrl, postData, agentSp, get) {
let ts = dayjs().valueOf().toString();
let rand = randStr(32);
let sign = Crypto.MD5('abcdexxxdd2daklmn25129_' + ts + '_' + rand)
.toString()
.toLowerCase();
let headers = {
'user-agent': agentSp || device.ua,
};
if (reqUrl.includes('baibaipei')) {
headers['device-id'] = device.id;
headers['push-token'] = '';
headers['sign'] = sign;
headers['time'] = ts;
headers['md5'] = rand;
headers['version'] = '2.1.0';
headers['system-model'] = device.model;
headers['system-brand'] = device.brand;
headers['system-version'] = device.release;
}
let res = await req(reqUrl, {
method: get ? 'get' : 'post',
headers: headers,
data: postData || {},
postType: get ? '' : 'form',
});
let content = res.content;
// console.log(content);
return content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
var deviceKey = 'device';
var deviceInfo = await local.get(key, deviceKey);
if (deviceInfo.length > 0) {
try {
device = JSON.parse(deviceInfo);
} catch (error) {}
}
if (_.isEmpty(device)) {
device = randDevice();
device.id = randStr(33).toLowerCase();
device.ua = 'okhttp/4.1.0';
await local.set(key, deviceKey, JSON.stringify(device));
}
}
async function home(filter) {
// await req('https://www.facebook.com', {});
let data = JSON.parse(await request(url + '/api.php/Index/getTopVideoCategory')).data;
let classes = [];
let filterObj = {};
for (const type of data) {
let typeName = type.nav_name;
if (typeName == '推荐') continue;
let typeId = type.nav_type_id.toString();
classes.push({
type_id: typeId,
type_name: typeName,
});
if (!filter) continue;
try {
let filterAll = [];
let filterData = JSON.parse(await request(url + '/api.php/Video/getFilterType', { type: typeId })).data;
for (let key of Object.keys(filterData)) {
let itemValues = filterData[key];
if (key === 'plot') key = 'class';
let typeExtendName = '';
switch (key) {
case 'class':
typeExtendName = '类型';
break;
case 'area':
typeExtendName = '地区';
break;
case 'lang':
typeExtendName = '语言';
break;
case 'year':
typeExtendName = '年代';
break;
case 'sort':
typeExtendName = '排序';
break;
}
if (typeExtendName.length === 0) continue;
let newTypeExtend = {
key: key,
name: typeExtendName,
};
let newTypeExtendKV = [];
for (let j = 0; j < itemValues.length; j++) {
const name = itemValues[j];
let value = key === 'sort' ? j + '' : name === '全部' ? '0' : name;
newTypeExtendKV.push({ n: name, v: value });
}
newTypeExtend['init'] = key === 'sort' ? '1' : newTypeExtendKV[0]['v'];
newTypeExtend.value = newTypeExtendKV;
filterAll.push(newTypeExtend);
}
if (!_.isEmpty(filterAll)) {
filterObj[typeId] = filterAll;
}
} catch (e) {
console.log(e);
}
}
// console.log(await homeVod());
// console.log(classes);
// console.log(filterObj);
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
let jsonArray = JSON.parse(await request(url + '/api.php/Index/getHomePage', { type: 1, p: 1 })).data.video;
let videos = [];
for (const item of jsonArray) {
if (item.title.styleType !== 0) continue;
for (const vObj of item.list) {
videos.push({
vod_id: vObj.vod_id,
vod_name: vObj.vod_name,
vod_pic: vObj.vod_pic,
vod_remarks: vObj.vod_remarks || vObj.vod_score || '',
});
}
}
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg == 0) pg = 1;
let reqUrl = url + '/api.php/Video/getFilterVideoList';
var formData = JSON.parse(
jinja2(
`{
"type": "{{tid}}",
"p": "{{pg}}",
"area": "{{ext.area|default(0)}}",
"year": "{{ext.year|default(0)}}",
"sort": "{{ext.sort|default(0)}}",
"class": "{{ext.class|default(0)}}"
}`,
{ ext: extend, tid: tid, pg: pg }
)
);
console.log(formData);
let data = JSON.parse(await request(reqUrl, formData)).data;
let videos = [];
for (const vod of data.data) {
videos.push({
vod_id: vod.vod_id,
vod_name: vod.vod_name,
vod_pic: vod.vod_pic,
vod_remarks: vod.vod_remarks || vod.vod_score || '',
});
}
return JSON.stringify({
page: parseInt(data.current_page),
pagecount: parseInt(data.last_page),
limit: parseInt(data.per_page),
total: parseInt(data.total),
list: videos,
});
}
async function detail(id) {
let data = JSON.parse(await request(url + '/api.php/Video/getVideoInfo', { video_id: id })).data.video;
let vod = {
vod_id: data.vod_id,
vod_name: data.vod_name,
vod_pic: data.vod_pic,
type_name: data.vod_class,
vod_year: data.vod_year,
vod_area: data.vod_area,
vod_remarks: data.vod_remarks || '',
vod_actor: data.vod_actor,
vod_director: data.vod_director,
vod_content: data.vod_content.trim(),
};
let playlist = {};
for (const item of data.vod_play) {
let from = item.playerForm;
if (from === 'jp') continue;
if (from === 'xg') continue;
let urls = [];
for (const u of item.url) {
urls.push(formatPlayUrl(vod.vod_name, u.title) + '$' + u.play_url);
}
if (!playlist.hasOwnProperty(from) && urls.length > 0) {
playlist[from] = urls;
}
}
parse = data.parse || [];
vod.vod_play_from = _.keys(playlist).join('$$$');
let urls = _.values(playlist);
let vod_play_url = [];
for (const urlist of urls) {
vod_play_url.push(urlist.join('#'));
}
vod.vod_play_url = vod_play_url.join('$$$');
return JSON.stringify({
list: [vod],
});
}
var parse = [];
async function play(flag, id, flags) {
try {
if (id.indexOf('youku') >= 0 || id.indexOf('iqiyi') >= 0 || id.indexOf('v.qq.com') >= 0 || id.indexOf('pptv') >= 0 || id.indexOf('le.com') >= 0 || id.indexOf('1905.com') >= 0 || id.indexOf('mgtv') >= 0) {
if (parse.length > 0) {
for (let index = 0; index < parse.length; index++) {
try {
const p = parse[index];
let res = await req(p + id, {
headers: { 'user-agent': 'okhttp/4.1.0' },
});
var result = jsonParse(id, JSON.parse(res.content));
if (result.url) {
result.parse = 0;
return JSON.stringify(result);
}
} catch (error) {}
}
}
}
if (id.indexOf('jqq-') >= 0) {
var jqqHeader = await request(url + '/jqqheader.json', null, null, true);
var jqqHeaders = JSON.parse(jqqHeader);
var ids = id.split('-');
var jxJqq = await req('https://api.juquanquanapp.com/app/drama/detail?dramaId=' + ids[1] + '&episodeSid=' + ids[2] + '&quality=LD', { headers: jqqHeaders });
var jqqInfo = JSON.parse(jxJqq.content);
if (jqqInfo.data.playInfo.url) {
return JSON.stringify({
parse: 0,
playUrl: '',
url: jqqInfo.data.playInfo.url,
});
}
}
let res = await request(url + '/video.php', { url: id });
var result = jsonParse(id, JSON.parse(res).data);
if (result.url) {
result.parse = 0;
// demo of block hls ads
if (/vip\.lz|hd\.lz/.test(result.url)) {
result.url = await js2Proxy(true, siteType, siteKey, 'lzm3u8/' + base64Encode(result.url), {});
}
return JSON.stringify(result);
}
return JSON.stringify({
parse: 0,
playUrl: '',
url: id,
});
} catch (e) {
console.log(e);
return JSON.stringify({
parse: 0,
url: id,
});
}
}
async function proxy(segments, headers) {
let what = segments[0];
let url = base64Decode(segments[1]);
if (what == 'lzm3u8') {
const resp = await req(url, {});
let hls = resp.content;
const jsBase = await js2Proxy(false, siteType, siteKey, 'lzm3u8/', {});
const baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
console.log(hls.length);
hls = hls.replace(/#EXT-X-DISCONTINUITY\r*\n*#EXTINF:6.433333,[\s\S]*?#EXT-X-DISCONTINUITY/, '');
console.log(hls.length);
hls = hls.replace(/(#EXT-X-KEY\S+URI=")(\S+)("\S+)/g, function (match, p1, p2, p3) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + up + p3;
});
hls = hls.replace(/(#EXT-X-STREAM-INF:.*\n)(.*)/g, function (match, p1, p2) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + jsBase + base64Encode(up);
});
hls = hls.replace(/(#EXTINF:.*\n)(.*)/g, function (match, p1, p2) {
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
return p1 + up;
});
return JSON.stringify({
code: resp.code,
content: hls,
headers: resp.headers,
});
}
return JSON.stringify({
code: 500,
content: '',
});
}
async function search(wd, quick) {
let data = JSON.parse(await request(url + '/api.php/Search/getSearch', { key: wd, type_id: 0, p: 1 })).data;
let videos = [];
for (const vod of data.data) {
videos.push({
vod_id: vod.vod_id,
vod_name: vod.vod_name,
vod_pic: vod.vod_pic,
vod_remarks: vod.vod_remarks || vod.vod_score || '',
});
}
return JSON.stringify({
list: videos,
});
}
function base64Encode(text) {
return Crypto.enc.Base64.stringify(Crypto.enc.Utf8.parse(text));
}
function base64Decode(text) {
return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
}
const charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
function randStr(len, withNum) {
var _str = '';
let containsNum = withNum === undefined ? true : withNum;
for (var i = 0; i < len; i++) {
let idx = _.random(0, containsNum ? charStr.length - 1 : charStr.length - 11);
_str += charStr[idx];
}
return _str;
}
function randDevice() {
return {
brand: 'Huawei',
model: 'HUAWEI Mate 20',
release: '10',
buildId: randStr(3, false).toUpperCase() + _.random(11, 99) + randStr(1, false).toUpperCase(),
};
}
function formatPlayUrl(src, name) {
return name
.trim()
.replaceAll(src, '')
.replace(/<|>|《|》/g, '')
.replace(/\$|#/g, ' ')
.trim();
}
function jsonParse(input, json) {
try {
let url = json.url ?? '';
if (url.startsWith('//')) {
url = 'https:' + url;
}
if (!url.startsWith('http')) {
return {};
}
let headers = json['headers'] || {};
let ua = (json['user-agent'] || '').trim();
if (ua.length > 0) {
headers['User-Agent'] = ua;
}
let referer = (json['referer'] || '').trim();
if (referer.length > 0) {
headers['Referer'] = referer;
}
_.keys(headers).forEach((hk) => {
if (!headers[hk]) delete headers[hk];
});
return {
header: headers,
url: url,
};
} catch (error) {
console.log(error);
}
return {};
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
proxy: proxy,
search: search,
};
}

View File

@ -70,10 +70,6 @@ async function init(cfg) {
device.ua = 'Dalvik/2.1.0 (Linux; U; Android ' + device.release + '; ' + device.model + ' Build/' + device.buildId + ')';
await local.set(key, deviceKey, JSON.stringify(device));
}
await request(url + '/api.php/provide/getDomain');
await request(url + '/api.php/provide/config');
await request(url + '/api.php/provide/checkUpgrade');
await request(url + '/api.php/provide/channel');
}
async function home(filter) {

View File

@ -1,3 +1,4 @@
// 修正:分类改静态 (网站频繁变动分类)
import { load, _ } from "assets://js/lib/cat.js";
let key = "酷奇MV";
@ -26,19 +27,20 @@ async function init(cfg) {
}
async function home(filter) {
var html = await request(HOST);
var $ = load(html);
var class_parse = $(".main > li > a[href*=play]");
var classes = [];
classes = _.map(class_parse, (cls) => {
var typeId = cls.attribs["href"];
typeId = typeId.substring(typeId.lastIndexOf("/") + 1).replace(".html", "");
return {
type_id: typeId,
type_name: cls.children[0].data,
};
});
var filterObj = {};
var classes = [{ "type_id": "1", "type_name": "华语高清" }, { "type_id": "2", "type_name": "日韩精选" }, { "type_id": "3", "type_name": "欧美MV" }, { "type_id": "4", "type_name": "高清现场" }, { "type_id": "5", "type_name": "影视MV" }, { "type_id": "6", "type_name": "夜店视频" }, { "type_id": "7", "type_name": "车模视频" }, { "type_id": "8", "type_name": "热舞视频" }, { "type_id": "9", "type_name": "美女写真" }, { "type_id": "10", "type_name": "美女打碟" }];
// const html = await request(HOST);
// const $ = load(html);
// const class_parse = $(".lei_fl > a[href*=play]");
// const classes = [];
// classes = _.map(class_parse, (cls) => {
// const typeId = cls.attribs["href"];
// typeId = typeId.substring(typeId.lastIndexOf("/") + 1).replace(".html", "");
// return {
// type_id: typeId,
// type_name: cls.children[0].data,
// };
// });
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
@ -50,15 +52,15 @@ async function home(filter) {
}
async function homeVod() {
var link = HOST + "/play/9_1.html";
var html = await request(link);
var $ = load(html);
var items = $("div.mv_list > li");
var videos = _.map(items, (it) => {
var a = $(it).find("a:first")[0];
var img = $(it).find("img:first")[0];
var singer = $($(it).find("div.singer")[0]).text().trim();
var remarks = $($(it).find("span.lei_03")[0]).text().trim();
const link = HOST + "/play/9_1.html";
const html = await request(link);
const $ = load(html);
const items = $("div.mv_list > li");
let videos = _.map(items, (it) => {
const a = $(it).find("a:first")[0];
const img = $(it).find("img:first")[0];
const singer = $($(it).find("div.singer")[0]).text().trim();
const remarks = $($(it).find("span.lei_03")[0]).text().trim();
return {
vod_id: a.attribs.href.replace(/.*?\/play\/(.*).html/g, "$1"),
vod_name: a.attribs.title,
@ -73,15 +75,15 @@ async function homeVod() {
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
var link = HOST + "/play/" + tid + "_" + pg + ".html";
var html = await request(link);
var $ = load(html);
var items = $("div.mv_list > li");
var videos = _.map(items, (it) => {
var a = $(it).find("a:first")[0];
var img = $(it).find("img:first")[0];
var singer = $($(it).find("div.singer")[0]).text().trim();
var remarks = $($(it).find("span.lei_03")[0]).text().trim();
const link = HOST + "/play/" + tid + "_" + pg + ".html";
const html = await request(link);
const $ = load(html);
const items = $("div.mv_list > li");
let videos = _.map(items, (it) => {
const a = $(it).find("a:first")[0];
const img = $(it).find("img:first")[0];
const singer = $($(it).find("div.singer")[0]).text().trim();
const remarks = $($(it).find("span.lei_03")[0]).text().trim();
return {
vod_id: a.attribs.href.replace(/.*?\/play\/(.*).html/g, "$1"),
vod_name: a.attribs.title,
@ -89,8 +91,8 @@ async function category(tid, pg, filter, extend) {
vod_remarks: "🎤" + singer + "" + remarks || "",
};
});
var hasMore = $("div.lei_page > a:contains(下一页)").length > 0;
var pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
const hasMore = $("div.lei_page > a:contains(下一页)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
@ -101,11 +103,11 @@ async function category(tid, pg, filter, extend) {
}
async function detail(id) {
var vod = {
const vod = {
vod_id: id,
vod_remarks: "",
};
var playlist = ["观看视频" + "$" + id];
const playlist = ["观看视频" + "$" + id];
vod.vod_play_from = "道长在线";
vod.vod_play_url = playlist.join("#");
return JSON.stringify({
@ -114,11 +116,11 @@ async function detail(id) {
}
async function play(flag, id, flags) {
var link = HOST + "/skin/kuqimv/play.php";
var ref = HOST + "/play/" + id + ".html";
var pdata = { id: id };
var playUrl = JSON.parse(await request(link, ref, "post", pdata)).url;
var headers = {
const link = HOST + "/skin/kuqimv/play.php";
const ref = HOST + "/play/" + id + ".html";
const pdata = { id: id };
const playUrl = JSON.parse(await request(link, ref, "post", pdata)).url;
const headers = {
Referer: HOST,
};
return JSON.stringify({
@ -130,14 +132,14 @@ async function play(flag, id, flags) {
async function search(wd, quick, pg) {
if (pg <= 0 || typeof pg == "undefined") pg = 1;
let link = HOST + "/search.php?key=" + wd + "&pages=" + pg;
var html = await request(link);
var $ = load(html);
var items = $("div.video_list > li");
var videos = _.map(items, (it) => {
var a = $(it).find("a:first")[0];
var singer = $($(it).find("div.singer")[0]).text().trim();
var remarks = $($(it).find("span.lei_04")[0]).text().trim();
const link = HOST + "/search.php?key=" + wd + "&pages=" + pg;
const html = await request(link);
const $ = load(html);
const items = $("div.video_list > li");
let videos = _.map(items, (it) => {
const a = $(it).find("a:first")[0];
const singer = $($(it).find("div.singer")[0]).text().trim();
const remarks = $($(it).find("span.lei_04")[0]).text().trim();
return {
vod_id: a.attribs.href.replace(/.*?\/play\/(.*).html/g, "$1"),
vod_name: a.attribs.title,
@ -145,8 +147,8 @@ async function search(wd, quick, pg) {
vod_remarks: "🎤" + singer + "" + remarks || "",
};
});
var hasMore = $("div.lei_page > a:contains(>)").length > 0;
var pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
const hasMore = $("div.lei_page > a:contains(>)").length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,

1
cat/lbgs_book_open.js Normal file

File diff suppressed because one or more lines are too long

1
cat/lbgs_open.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
import { load, _ } from './lib/cat.js';
var key = 'libvio';
var HOST = 'https://libvio.app'; // 地址发布页
var HOST = 'https://www.libvio.pro'; // 地址发布页
var host = '';
var siteKey = '';
var siteType = 0;

File diff suppressed because one or more lines are too long

1
cat/nivod_op.js Normal file

File diff suppressed because one or more lines are too long

1
cat/tutu_open.js Normal file

File diff suppressed because one or more lines are too long

135
cat/tuxiaobei_open.js Normal file
View File

@ -0,0 +1,135 @@
import { load, _ } from './lib/cat.js';
let key = '🐰兔小贝';
let HOST = 'https://www.tuxiaobei.com';
let siteKey = '';
let siteType = 0;
const IOS_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || IOS_UA,
},
});
return res.content
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype
}
async function home(filter) {
const classes = [{ type_id: '', type_name: '🐰全部' }, { type_id: 2, type_name: '🐰儿歌' }, { type_id: 3, type_name: '🐰故事' }, { type_id: 27, type_name: '🐰公益' }, { type_id: 9, type_name: '🐰十万个为什么' }, { type_id: 28, type_name: '🐰安全教育' }, { type_id: 29, type_name: '🐰动物奇缘' }, { type_id: 7, type_name: '🐰弟子规' }, { type_id: 5, type_name: '🐰古诗' }, { type_id: 6, type_name: '🐰三字经' }, { type_id: 8, type_name: '🐰千字文' }, { type_id: 11, type_name: '🐰数学' }, { type_id: 25, type_name: '🐰英语' }, { type_id: 24, type_name: '🐰折纸' }];
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
return cls;
}),
filters: filterObj,
})
}
async function homeVod() {
const link = await request(HOST + '/list/mip-data?typeId=9&page=1&callback=');
const html = link.match(/\((.*?)\);/)[1];
const data = JSON.parse(html).data;
let videos = _.map(data.items, (it) => {
return {
vod_id: it.video_id,
vod_name: it.name,
vod_pic: it.image,
vod_remarks: it.root_category_name + ' | ' + it.duration_string || '',
}
});
return JSON.stringify({
list: videos,
})
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == 'undefined') pg = 1;
const link = await request(HOST + '/list/mip-data?typeId=' + tid + '&page=' + pg + '&callback=');
const html = link.match(/\((.*?)\);/)[1];
const data = JSON.parse(html).data;
let videos = _.map(data.items, (it) => {
return {
vod_id: it.video_id,
vod_name: it.name,
vod_pic: it.image,
vod_remarks: it.root_category_name + ' | ' + it.duration_string || '',
}
});
const pgCount = pg * 30 > data.totalCount ? parseInt(pg) : parseInt(pg) + 1;
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 30,
total: data.totalCount,
list: videos,
})
}
async function detail(id) {
const vod = {
vod_id: id,
vod_remarks: '',
};
const playlist = ['点击播放' + '$' + HOST + '/play/' + id];
vod.vod_play_from = "道长在线";
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const html = await request(id);
const $ = load(html);
const pvideo = $("body mip-search-video[video-src*=http]");
const purl = pvideo[0].attribs['video-src'];
// console.debug('兔小贝 purl =====>' + purl); // js_debug.log
return JSON.stringify({
parse: 0,
url: purl,
});
}
async function search(wd, quick) {
const link = HOST + "/search/" + wd;
const html = await request(link);
const $ = load(html);
const list = $("div.list-con > div.items");
let videos = _.map(list, (it) => {
const a = $(it).find("a:first")[0];
const img = $(it).find("mip-img:first")[0];
const tt = $(it).find("p:first")[0];
const remarks = $(it).find("p")[1];
return {
vod_id: a.attribs.href.replace(/.*?\/play\/(.*)/g, '$1'),
vod_name: tt.children[0].data,
vod_pic: img.attribs["src"],
vod_remarks: remarks.children[0].data || "",
};
});
return JSON.stringify({
list: videos,
land: 1,
ratio: 1.78,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
}
}

118
cat/ubestkid_open.js Normal file
View File

@ -0,0 +1,118 @@
// 无搜索功能
import { _ } from './lib/cat.js';
let key = '🐯贝乐虎';
let HOST = 'https://vd.ubestkid.com';
let siteKey = '';
let siteType = 0;
const MOBILE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function request(reqUrl, referer, mth, data, hd) {
const headers = {
"User-Agent": MOBILE_UA,
};
if (referer) headers.referer = encodeURIComponent(referer);
let res = await req(reqUrl, {
method: mth || "get",
headers: headers,
data: data,
postType: mth === "post" ? "json" : "",
});
return res.content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype
}
async function home(filter) {
const classes = [{ type_id: 65, type_name: '🐯最新上架' }, { type_id: 113, type_name: '🐯人气热播' }, { type_id: 56, type_name: '🐯经典童谣' }, { type_id: 137, type_name: '🐯开心贝乐虎' }, { type_id: 53, type_name: '🐯律动儿歌' }, { type_id: 59, type_name: '🐯经典儿歌' }, { type_id: 101, type_name: '🐯超级汽车1' }, { type_id: 119, type_name: '🐯超级汽车第二季' }, { type_id: 136, type_name: '🐯超级汽车第三季' }, { type_id: 95, type_name: '🐯三字经' }, { type_id: 133, type_name: '🐯幼儿手势舞' }, { type_id: 117, type_name: '🐯哄睡儿歌' }, { type_id: 70, type_name: '🐯英文儿歌' }, { type_id: 116, type_name: '🐯节日与节气' }, { type_id: 97, type_name: '🐯恐龙世界' }, { type_id: 55, type_name: '🐯动画片儿歌' }, { type_id: 57, type_name: '🐯流行歌曲' }, { type_id: 118, type_name: '🐯贝乐虎入园记' }, { type_id: 106, type_name: '🐯贝乐虎大百科' }, { type_id: 62, type_name: '🐯经典古诗' }, { type_id: 63, type_name: '🐯经典故事' }, { type_id: 128, type_name: '🐯萌虎学功夫' }, { type_id: 100, type_name: '🐯绘本故事' }, { type_id: 121, type_name: '🐯开心贝乐虎英文版' }, { type_id: 96, type_name: '🐯嗨贝乐虎情商动画' }, { type_id: 108, type_name: '🐯动物音乐派对' }, { type_id: 126, type_name: '🐯动物音乐派对英文版' }, { type_id: 105, type_name: '🐯奇妙的身体' }, { type_id: 124, type_name: '🐯奇妙的身体英文版' }, { type_id: 64, type_name: '🐯认知卡片' }, { type_id: 109, type_name: '🐯趣味简笔画' }, { type_id: 78, type_name: '🐯数字儿歌' }, { type_id: 120, type_name: '🐯识字体验版' }, { type_id: 127, type_name: '🐯启蒙系列体验版' }];
const filterObj = {};
return JSON.stringify({
class: _.map(classes, (cls) => {
cls.land = 1;
cls.ratio = 1.78;
return cls;
}),
filters: filterObj,
})
}
async function homeVod() {
const link = HOST + "/api/v1/bv/video";
const pdata = { age: 1, appver: "6.1.9", egvip_status: 0, svip_status: 0, vps: 60, subcateId: 56, "p": 1 };
const jo = JSON.parse(await request(link, "", "post", pdata)).result;
const videos = [];
_.each(jo.items, (it) => {
videos.push({
vod_id: it.url,
vod_name: it.title,
vod_pic: it.image,
vod_remarks: '👀' + it.viewcount || '',
})
});
return JSON.stringify({
list: videos,
})
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof pg == 'undefined') pg = 1;
const link = HOST + "/api/v1/bv/video";
const pdata = { age: 1, appver: "6.1.9", egvip_status: 0, svip_status: 0, vps: 60, subcateId: tid, "p": pg };
const jo = JSON.parse(await request(link, "", "post", pdata)).result;
const videos = [];
_.each(jo.items, (it) => {
videos.push({
vod_id: it.url,
vod_name: it.title,
vod_pic: it.image,
vod_remarks: '👀' + it.viewcount || '',
})
});
const pgCount = pg * 60 > jo.total ? parseInt(pg) : parseInt(pg) + 1;
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 60,
total: jo.total,
list: videos,
})
}
async function detail(id) {
const vod = {
vod_id: id,
vod_remarks: '',
};
const playlist = ['点击播放' + '$' + id];
vod.vod_play_from = "道长在线";
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
// console.debug('贝乐虎 id =====>' + id); // js_debug.log
return JSON.stringify({
parse: 0,
url: id,
});
}
async function search(wd, quick) {
return '{}'
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
}
}

155
cat/wogg_open.js Normal file
View File

@ -0,0 +1,155 @@
import {load, _, Uri} from 'assets://js/lib/cat.js';
import {log} from 'assets://js/lib/utils.js';
import {initAli, detailContent, playContent} from 'assets://js/lib/ali.js';
let siteKey = 'wogg';
let siteType = 0;
let siteUrl = 'https://wogg.xyz';
let UA = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
let patternAli = /(https:\/\/www\.aliyundrive\.com\/s\/[^"]+)/
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
await initAli(cfg);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function request(reqUrl, agentSp) {
let header = {
'user-agent': agentSp || 'okhttp/3.12.0',
};
let uri = new Uri(reqUrl);
let res = await req(uri.toString(), {
headers: header,
timeout: 10000
});
let content = res.content;
return content;
}
function getHeader() {
let header = {};
header['User-Agent'] = UA;
return header;
}
async function getString(url) {
let res = await req(url, {
headers: getHeader()
});
return res.content;
}
let classes = [{'type_id': 1, 'type_name' : '电影'},{'type_id': 20, 'type_name' : '电视剧'},{'type_id': 28, 'type_name' : '综艺'},{'type_id': 24, 'type_name' : '动漫'},{'type_id': 32, 'type_name' : '音乐'}];
let filterObj = {};
async function home(filter) {
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
return '{}';
}
async function category(tid, pg, filter, extend) {
let reqUrl = siteUrl + '/index.php/vodshow/'+tid+'--------'+pg+'---.html';
let con = await request(reqUrl, UA);
const $ = load(con);
let items = $('.module:eq(0) > .module-list > .module-items > .module-item');
let videos = [];
for(var item of items) {
let oneA = $(item).find('.module-item-cover .module-item-pic a').first();
let href = oneA.attr('href');
let name = oneA.attr('title');
let oneImg = $(item).find('.module-item-cover .module-item-pic img').first();
let pic = oneImg.attr('data-src');
let remark = $(item).find('.module-item-text').first().text();
videos.push({
vod_id: href,
vod_name: name,
vod_pic: pic,
vod_remarks: remark,
});
}
const hasMore = $('#page > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 72,
total: 72 * pgCount,
list: videos,
});
}
async function detail(id) {
try {
await log('detail:id:---' + id);
let preMatches = id.match(patternAli);
if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]);
let url = siteUrl + id;
let aliUrl = await getString(url);
let matches = aliUrl.match(patternAli);
console.log('detailmatche---');
console.log(matches[1]);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return '';
} catch (e) {
await log( 'detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log( 'play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick) {
await log('search---' + wd);
let searchUrl = siteUrl + '/index.php/vodsearch/-------------.html?wd=' + wd;
let html = await getString(searchUrl);
let $ = load(html);
let items = $('.module-search-item');
let videos = [];
for(var item of items) {
let vodId = $(item).find(".video-serial")[0].attribs.href;
let name = $(item).find(".video-serial")[0].attribs.title;
let pic = $(item).find(".module-item-pic > img")[0].attribs['data-src'];
let remark = '';
videos.push({
vod_id: vodId,
vod_name: name,
vod_pic: pic,
vod_remarks: remark,
});
}
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

1
cat/xiaoya.js Normal file
View File

@ -0,0 +1 @@
import{Crypto,load,_}from"assets://js/lib/cat.js";let key="xiaoya-tv",url="",siteKey="",siteType=0;const UA="Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",cookie={};async function request(reqUrl,referer,mth,data,hd){var headers={"User-Agent":UA,Cookie:_.map(cookie,(value,key)=>key+"="+value).join(";")},referer=(referer&&(headers.referer=encodeURIComponent(referer)),await req(reqUrl,{method:mth||"get",headers:headers,data:data,postType:"post"===mth?"form":""}));return referer.content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype,url=cfg.ext}async function home(filter){return(await request(url)).replaceAll("1$/$1","1$/$0")}async function homeVod(){return"{}"}async function category(tid,pg,filter,extend){pg<=0&&(pg=1);let api=url+"?t="+tid+"&pg="+pg;return extend&&(tid=Object.entries(extend).map(([key,val]=entry)=>"&"+key+"="+val),api=(api+=tid)+("&f="+encodeURIComponent(JSON.stringify(extend)))),request(api)}async function detail(id){id=id.split("$");return request(url+"?ids="+id[0]+"$"+id[1])}async function play(flag,id,flags){return request(url.replace("/vod1","/play")+"?id="+id+"&from=open")}async function search(wd,quick){return request(url+"?wd="+wd)}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};

1
cat/yqktv_open.js Normal file

File diff suppressed because one or more lines are too long

1
cat/yqktv_open2.js Normal file

File diff suppressed because one or more lines are too long

1
cat/yrzj_open.js Normal file

File diff suppressed because one or more lines are too long

1
cat/yt.js Normal file

File diff suppressed because one or more lines are too long

1
cat/yzys_open.js Normal file

File diff suppressed because one or more lines are too long

1
cat/猫农民.js Normal file

File diff suppressed because one or more lines are too long

1
cat/猫南瓜.js Normal file

File diff suppressed because one or more lines are too long

1
cat/猫在线之家.js Normal file

File diff suppressed because one or more lines are too long

135
cat/猫短视频.js Normal file
View File

@ -0,0 +1,135 @@
// 搜索滑块验证
import { load, _ } from 'assets://js/lib/cat.js';
let key = '短视频';
let HOST = 'http://www.sharenice.net';
let siteKey = '';
let siteType = 0;
let PC_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36';
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || PC_UA,
},
});
return res.content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
function clsjoin(cls) {
_.each(cls, (s) => {
let typeId = s.attribs['href'];
typeId = typeId.substring(typeId.lastIndexOf('t/') + 2);
classes.push({
type_id: typeId,
type_name: s.children[0].data,
});
});
}
let classes = [];
async function home(filter) {
let filterObj = {};
let html = await request(HOST);
let $ = load(html);
let series = $('div.nav > ul > li > a[href*=net/]');
let tag = $('div.hot-tags-list > a[href*=net]');
clsjoin(series);
clsjoin(tag);
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
let link = HOST + '/t-576O5aWz';
let html = await request(link);
let $ = load(html);
let items = $('div.item-box ul li');
let videos = _.map(items, (item) => {
let a = $(item).find('a:first')[0];
let img = $(item).find('img:first')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
let link = HOST + '/' + tid + '?page=' + pg;
let html = await request(link);
let $ = load(html);
let items = $('div.item-box ul li');
let videos = _.map(items, (item) => {
let a = $(item).find('a:first')[0];
let img = $(item).find('img:first')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: '',
};
});
let hasMore = $('ul.pagination > li > a:contains(»)').length > 0;
let pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 16,
total: 16 * pgCount,
list: videos,
});
}
async function detail(id) {
let vod = {
vod_id: id,
vod_remarks: '',
};
let playlist = ['观看视频' + '$' + id];
vod.vod_play_from = '在线';
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
let html = await request(id);
let $ = load(html);
let playUrl = $('div.video-play-box').find('video:first')[0].attribs.src;
return JSON.stringify({
parse: 1,
url: playUrl,
});
}
async function search(wd, quick, pg) {
return '{}';
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}