Add files via upload

This commit is contained in:
n3rddd 2023-09-27 23:56:42 +08:00 committed by GitHub
parent 4632f56ae1
commit 35b44656e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 2410 additions and 1105 deletions

File diff suppressed because one or more lines are too long

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,
};
}

File diff suppressed because one or more lines are too long

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,
};
}

File diff suppressed because one or more lines are too long

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};

View File

@ -0,0 +1,136 @@
import { _ } from './lib/cat.js';
let key = 'bookkan';
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,
};
}

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

View File

@ -1,70 +1,591 @@
{ {
"video": { "video": {
"sites": [ "sites": [
{ {
"key": "kunyu77", "key": "kunyu77",
"name": "琨娱七七", "name": "🟢 七七",
"type": 3, "type": 3,
"api": "assets://js/kunyu77_open.js" "api": "kunyu77_open.js"
}
]
},
"pan": {
"sites": [
{
"key": "alist",
"name": "Alist",
"type": 40,
"api": "assets://js/alist_open.js",
"ext": [
{
"name": "🙋丫仙女",
"server": "http://alist.xiaoya.pro/",
"startPage": "/",
"showAll": false,
"search": true,
"headers": {
"Authorization": ""
}, },
"params": { {
"/abc": { "key": "555dy",
"password": "123" "name": "🟢 555",
}, "type": 3,
"/abc/abc": { "api": "555dy_open.js"
"password": "123" },
} {
"key": "czzy",
"name": "🟢 厂长",
"type": 3,
"api": "czzy_open.js"
},
{
"key": "ngsp",
"name": "🟢 南瓜",
"type": 3,
"api": "ng_open.js"
},
{
"key": "zxzj",
"name": "🟢 在线",
"type": 3,
"api": "zxzj_open.js"
},
{
"key": "ikanbot",
"name": "🟢 爱看",
"type": 3,
"api": "ikanbot_open.js"
},
{
"key": "kkys",
"name": "🟢 快看",
"type": 3,
"api": "kkys_open.js"
},
{
"key": "libvio",
"name": "🟢 立波",
"type": 3,
"api": "libvio_open.js"
},
{
"key": "subaibai",
"name": "🟢 素白",
"type": 3,
"api": "subaibai_open.js"
},
{
"key": "yqktv",
"name": "🟢 一起",
"type": 3,
"api": "yqktv_open2.js"
},
{
"key": "yzys",
"name": "🟢 柚子",
"type": 3,
"api": "yzys_open.js"
},
{
"key": "wogg",
"name": "🔵 玩偶",
"type": 3,
"api": "wogg.js",
"ext": "阿里token"
},
{
"key": "ytvip",
"name": "🔵 影探",
"type": 3,
"api": "yt.js",
"ext": "http://ytcms.lyyytv.cn/api.php/app/"
},
{
"key": "shijie",
"name": "🔵 视界",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://www.1080dyw.cc/api.php/v1.vod"
},
{
"key": "69mj",
"name": "🔵 美剧",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://www.69mj.com/xgapp.php/v2/"
},
{
"key": "aidi",
"name": "🔵 爱迪",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://api123.adys.app/xgapp.php/v3/"
},
{
"key": "hello",
"name": "🔵 哈喽",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://www.miniku.cc/xgapp.php/v1/"
},
{
"key": "beijihu",
"name": "🔵 极狐",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://www.kuin.one/api.php/app/"
},
{
"key": "kuku",
"name": "🔵 酷酷",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://cms.realdou.cn:35264/api.php/app/"
},
{
"key": "kuk",
"name": "🔵 天堂",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://dytt996.com/api.php/app/"
},
{
"key": "kku",
"name": "🔵 酷影",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://www.gsjtlxy.top/xgapp.php/v3/"
},
{
"key": "kkku",
"name": "🔵 琦琦",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://mp4.ghlyys.com/api.php/app/"
},
{
"key": "sukan",
"name": "🔵 速看",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://sk100.tv/api.php/app/"
},
{
"key": "dadou",
"name": "🔵 大豆",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://www.dadou.cm/api.php/app/"
},
{
"key": "qtw",
"name": "🔵 彩虹",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://ys.qtw.asia/lvdou_api.php/v1.vod"
},
{
"key": "yaya",
"name": "🔵 鸭奈",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://yayayaaapp.ynf.icu/api.php/app/"
},
{
"key": "aliys",
"name": "🔵 阿里",
"type": 3,
"api": "AppYsV2.js",
"ext": "http://aliys.cn:90/api.php/v1.vod"
},
{
"key": "1080dyw",
"name": "🔵 1080",
"type": 3,
"api": "AppYsV2.js",
"ext": "https://www.1080dyw.cc/api.php/v1.vod"
},
{
"key": "mifeng",
"name": "🔵 蜜蜂",
"api": "caiji.js",
"type": 3,
"ext": "https://www.beeyao.com/api.php/provide/vod/at/json"
},
{
"key": "jisu",
"name": "🔵 极速",
"type": 3,
"api": "caiji.js",
"ext": "https://jszyapi.com/api.php/provide/vod/from/jsm3u8/"
},
{
"key": "xinlang",
"name": "🔵 新浪",
"type": 3,
"api": "caiji.js",
"ext": "https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlm3u8"
},
{
"key": "liangzi",
"name": "🔵 量子",
"type": 3,
"api": "caiji.js",
"ext": "https://cj.lziapi.com/api.php/provide/vod/from/lzm3u8"
},
{
"key": "bdzy",
"name": "🔵 百度",
"type": 3,
"api": "caiji.js",
"ext": "https://api.apibdzy.com/api.php/provide/vod/from/dbm3u8/"
},
{
"key": "bfzy",
"name": "🔵 暴风",
"type": 3,
"api": "caiji.js",
"ext": "https://bfzyapi.com/api.php/provide/vod/"
},
{
"key": "languang",
"name": "🔵 蓝光",
"type": 3,
"api": "caiji.js",
"ext": "http://www.zzrhgg.com/api.php/provide/vod/"
},
{
"key": "lehuo",
"name": "🔵 乐活",
"type": 3,
"api": "caiji.js",
"ext": "https://cj.vodimg.top/api.php/provide/vod/"
},
{
"key": "yingtu",
"name": "🔵 影图",
"type": 3,
"api": "caiji.js",
"ext": "https://cj.vodimg.top/api.php/provide/vod/"
},
{
"key": "feifan",
"name": "🔵 非凡",
"type": 3,
"api": "caiji.js",
"ext": "https://cj.ffzyapi.com/api.php/provide/vod/from/ffm3u8/"
},
{
"key": "feisu",
"name": "🔵 飞速",
"type": 3,
"api": "caiji.js",
"ext": "https://www.feisuzyapi.com/api.php/provide/vod/from/fsm3u8/"
},
{
"key": "ikun",
"name": "🔵 爱坤",
"type": 3,
"api": "caiji.js",
"ext": "https://ikunzyapi.com/api.php/provide/vod"
},
{
"key": "suoni",
"name": "🔵 索尼",
"type": 3,
"api": "caiji.js",
"ext": {
"url": "https://suoniapi.com/api.php/provide/vod/from/snm3u8/",
"categories": [
"动作片",
"喜剧片",
"爱情片",
"科幻片",
"恐怖片",
"剧情片",
"战争片",
"国产剧",
"欧美剧",
"韩剧",
"日剧",
"港剧",
"台剧",
"海外剧",
"大陆综艺",
"国产动漫"
]
}
},
{
"key": "liuyou",
"name": "官方[六优]",
"api": "caiji.js",
"type": 3,
"ext": "http://www.6uzy.cc/inc/apijson_vod.php"
},
{
"key": "vipmv",
"name": "官方[天堂]",
"type": 3,
"api": "caiji.js",
"ext": "http://vipmv.cc/api.php/provide/vod/at/json"
},
{
"key": "sanjiu",
"name": "影视[三九]",
"api": "caiji.js",
"type": 3,
"ext": "https://www.39kan.com/api.php/provide/vod/at/json"
},
{
"key": "piaohua",
"name": "影视[飘花]",
"api": "caiji.js",
"type": 3,
"ext": "http://www.zzrhgg.com/api.php/provide/vod/at/json"
},
{
"key": "49zyw",
"name": "影视[四九]",
"type": 3,
"api": "caiji.js",
"ext": "https://49zyw.com/api.php/provide/vod/at/json"
},
{
"key": "68zy88",
"name": "影视[六八]",
"type": 3,
"api": "caiji.js",
"ext": "https://68zy88.com/api.php/provide/vod/at/json"
},
{
"key": "subo",
"name": "影视[速博]",
"type": 3,
"api": "caiji.js",
"ext": "https://subocaiji.com/api.php/provide/vod/at/json"
},
{
"key": "huyaapi",
"name": "影视[虎牙]",
"type": 3,
"api": "caiji.js",
"ext": "https://www.huyaapi.com/api.php/provide/vod/at/json"
},
{
"key": "kuakezy1",
"name": "影视[夸克]",
"type": 3,
"api": "caiji.js",
"ext": "http://kuakezy1.com/api.php/provide/vod/at/json"
},
{
"key": "qhzyapi",
"name": "影视[奇虎]",
"type": 3,
"api": "caiji.js",
"ext": "https://caiji.qhzyapi.com/api.php/provide/vod/at/json"
},
{
"key": "kswandouzy",
"name": "影视[豌豆]",
"type": 3,
"api": "caiji.js",
"ext": "https://ks.wandouzy.cc/api.php/provide/vod/at/json"
},
{
"key": "jiguang",
"name": "影视[极光]",
"type": 3,
"api": "caiji.js",
"ext": "https://jiguang.la/api.php/provide/vod/at/json"
},
{
"key": "hw8",
"name": "影视[华为]",
"type": 3,
"api": "caiji.js",
"ext": "https://hw8.live/api.php/provide/vod/at/json"
},
{
"key": "xzcjz",
"name": "影视[熊掌]",
"type": 3,
"api": "caiji.js",
"ext": "https://xzcjz.com/api.php/provide/vod/at/json"
},
{
"key": "kekezyapi",
"name": "影视[可可]",
"type": 3,
"api": "caiji.js",
"ext": "https://caiji.kekezyapi.com/api.php/provide/vod/at/json"
},
{
"key": "xkanzy10",
"name": "影视[享看]",
"type": 3,
"api": "caiji.js",
"ext": "https://xkanzy10.com/api.php/provide/vod/at/json"
},
{
"key": "damozy",
"name": "影视[大漠]",
"type": 3,
"api": "caiji.js",
"ext": "https://damozy.com/api.php/provide/vod/at/json"
},
{
"key": "kuaikan-api",
"name": "影视[快看]",
"type": 3,
"api": "caiji.js",
"ext": "https://kuaikan-api.com/api.php/provide/vod/at/json"
},
{
"key": "kuaiyunzy",
"name": "影视[快云]",
"type": 3,
"api": "caiji.js",
"ext": "https://www.kuaiyunzy.com/api.php/provide/vod/at/json"
},
{
"key": "jszyapi",
"name": "影视[极速]",
"type": 3,
"api": "caiji.js",
"ext": "https://jszyapi.com/api.php/provide/vod/at/json"
},
{
"key": "hhzyapi",
"name": "影视[火狐]",
"type": 3,
"api": "caiji.js",
"ext": "https://hhzyapi.com/api.php/provide/vod/at/json"
},
{
"key": "ikunzyapi",
"name": "影视[爱坤]",
"type": 3,
"api": "caiji.js",
"ext": "https://ikunzyapi.com/api.php/provide/vod/at/json"
},
{
"key": "42",
"name": "影视[四二]",
"type": 3,
"api": "caiji.js",
"ext": "https://www.42.la/api.php/provide/vod/from/42m3u8/at/json"
},
{
"key": "kczyapi",
"name": "影视[快车]",
"type": 3,
"api": "caiji.js",
"ext": "https://caiji.kczyapi.com/api.php/provide/vod/at/json"
},
{
"key": "collectwolongzyw",
"name": "影视[卧龙]",
"type": 3,
"api": "caiji.js",
"ext": "https://collect.wolongzyw.com/api.php/provide/vod/at/json"
},
{
"key": "m3u8apiyhzy",
"name": "影视[樱花]",
"type": 3,
"api": "caiji.js",
"ext": "https://m3u8.apiyhzy.com/api.php/provide/vod/at/json"
},
{
"key": "sdzyapi",
"name": "影视[闪电]",
"type": 3,
"api": "caiji.js",
"ext": "http://sdzyapi.com/api.php/provide/vod/at/json"
},
{
"key": "hanjuzy",
"name": "影视[韩剧]",
"type": 3,
"api": "caiji.js",
"ext": "http://www.hanjuzy.com/inc/apijson_vod.php"
},
{
"key": "cjbajiecaiji",
"name": "影视[八戒]",
"type": 3,
"api": "caiji.js",
"ext": "http://cj.bajiecaiji.com/inc/apijson_vod.php"
},
{
"key": "apiapibdzy",
"name": "影视[百度]",
"type": 3,
"api": "caiji.js",
"ext": "https://api.apibdzy.com/api.php/provide/vod/at/json"
},
{
"key": "apiwujinapi",
"name": "影视[无尽]",
"type": 3,
"api": "caiji.js",
"ext": "https://api.wujinapi.net/api.php/provide/vod/at/json"
},
{
"key": "apitiankongapi",
"name": "影视[天空]",
"type": 3,
"api": "caiji.js",
"ext": "https://api.tiankongapi.com/api.php/provide/vod/at/json"
},
{
"key": "pgfenwe078",
"name": "影视[四圈]",
"type": 3,
"api": "caiji.js",
"ext": "https://pg.fenwe078.cf/api.php/provide/vod/at/json"
},
{
"key": "rrvipw",
"name": "影视[人人]",
"type": 3,
"api": "caiji.js",
"ext": "https://www.rrvipw.com/api.php/provide/vod/at/json"
},
{
"key": "haowywz",
"name": "影视[小小]",
"type": 3,
"api": "caiji.js",
"ext": "http://haowywz.com/api.php/provide/vod/at/json"
},
{
"key": "cjvodimg",
"name": "影视[影图]",
"type": 3,
"api": "caiji.js",
"ext": "https://cj.vodimg.top/api.php/provide/vod/at/json"
},
{
"key": "p2100",
"name": "影视[飘零]",
"type": 3,
"api": "caiji.js",
"ext": "https://p2100.net/api.php/provide/vod/at/json"
},
{
"key": "moviegsl99",
"name": "影视[新马]",
"type": 3,
"api": "caiji.js",
"ext": "https://movie.gsl99.com/api.php/provide/vod/at/json"
},
{
"key": "feifei67",
"name": "影视[飞飞]",
"type": 3,
"api": "caiji.js",
"ext": "http://www.feifei67.com/api.php/provide/vod/at/json"
} }
},
{
"name": "🐋一只鱼",
"server": "https://alist.youte.ml"
},
{
"name": "🌊七米蓝",
"server": "https://al.chirmyram.com"
},
{
"name": "🐉神族九帝",
"server": "https://alist.shenzjd.com"
},
{
"name": "☃️姬路白雪",
"server": "https://pan.jlbx.xyz"
},
{
"name": "✨星梦",
"server": "https://pan.bashroot.top"
},
{
"name": "💢repl",
"server": "https://ali.liucn.repl.co"
},
{
"name": "💦讯维云盘",
"server": "https://pan.xwbeta.com"
}
] ]
} },
] "read": {
} "sites": [
]
},
"pan": {
"sites": [
{
"key": "alist",
"name": "Alist",
"type": 40,
"api": "alist_open.js",
"ext": [
]
}
]
}
} }

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,
};
}

View File

@ -1,7 +1,7 @@
import { Crypto, load, _ } from './lib/cat.js'; import { Crypto, load, _ } from './lib/cat.js';
let key = 'ikanbot'; let key = 'ikanbot';
let url = 'https://www.ikanbot.com'; let url = 'https://www.aikanbot.com';
let siteKey = ''; let siteKey = '';
let siteType = 0; let siteType = 0;
@ -116,7 +116,7 @@ async function detail(id) {
vod_area: $(detail).find('h3:nth-child(4)').text(), vod_area: $(detail).find('h3:nth-child(4)').text(),
vod_actor: $(detail).find('h3:nth-child(5)').text(), vod_actor: $(detail).find('h3:nth-child(5)').text(),
}; };
const res = await req(url + '/api/getResN?videoId=' + id.substring(id.lastIndexOf('/') + 1) + '&mtype=2', { const res = await req(url + '/api/getResN?videoId=' + id.substring(id.lastIndexOf('/') + 1) + '&mtype=2&token=9109590b194731fde643ce27924fcf6f', {
headers: { headers: {
Referer: 'play', Referer: 'play',
'User-Agent': UA, 'User-Agent': UA,
@ -140,25 +140,25 @@ async function detail(id) {
arr.push({ arr.push({
flag: '快看', flag: '快看',
url: playlist[key], url: playlist[key],
sort: 1 sort: 4
}) })
} else if ('bfzym3u8' == key) { } else if ('bfzym3u8' == key) {
arr.push({ arr.push({
flag: '暴风', flag: '暴风',
url: playlist[key], url: playlist[key],
sort: 2 sort: 1
}) })
} else if ('ffm3u8' == key) { } else if ('ffm3u8' == key) {
arr.push({ arr.push({
flag: '非凡', flag: '非凡',
url: playlist[key], url: playlist[key],
sort: 3 sort: 2
}) })
} else if ('lzm3u8' == key) { } else if ('lzm3u8' == key) {
arr.push({ arr.push({
flag: '量子', flag: '量子',
url: playlist[key], url: playlist[key],
sort: 4 sort: 3
}) })
} else { } else {
arr.push({ arr.push({

View File

@ -1,412 +1,8 @@
import { Crypto, dayjs, jinja2, _ } from './lib/cat.js'; import{Crypto,dayjs,jinja2,_}from"assets://js/lib/cat.js";let key="kkys",url="https://api1.baibaipei.com:8899",device={},siteKey="",siteType=0;async function request(reqUrl,postData,agentSp,get){var ts=dayjs().valueOf().toString(),rand=randStr(32),sign=Crypto.MD5("abcdexxxdd2daklmn25129_"+ts+"_"+rand).toString().toLowerCase(),agentSp={"user-agent":agentSp||device.ua},sign=(reqUrl.includes("baibaipei")&&(agentSp["device-id"]=device.id,agentSp["push-token"]="",agentSp.sign=sign,agentSp.time=ts,agentSp.md5=rand,agentSp.version="2.1.0",agentSp["system-model"]=device.model,agentSp["system-brand"]=device.brand,agentSp["system-version"]=device.release),await req(reqUrl,{method:get?"get":"post",headers:agentSp,data:postData||{},postType:get?"":"form"}));return sign.content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype;cfg=await local.get(key,"device");if(0<cfg.length)try{device=JSON.parse(cfg)}catch(error){}_.isEmpty(device)&&((device=randDevice()).id=randStr(33).toLowerCase(),device.ua="okhttp/4.1.0",await local.set(key,"device",JSON.stringify(device)))}async function home(filter){var classes=[],filterObj={};for(const type of JSON.parse(await request(url+"/api.php/Index/getTopVideoCategory")).data){var typeName=type.nav_name;if("推荐"!=typeName){var typeId=type.nav_type_id.toString();if(classes.push({type_id:typeId,type_name:typeName}),filter)try{var key,filterAll=[],filterData=JSON.parse(await request(url+"/api.php/Video/getFilterType",{type:typeId})).data;for(key of Object.keys(filterData)){var itemValues=filterData[key];"plot"===key&&(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="排序"}if(0!==typeExtendName.length){var newTypeExtend={key:key,name:typeExtendName},newTypeExtendKV=[];for(let j=0;j<itemValues.length;j++){var name=itemValues[j],value="sort"===key?j+"":"全部"===name?"0":name;newTypeExtendKV.push({n:name,v:value})}newTypeExtend.init="sort"===key?"1":newTypeExtendKV[0].v,newTypeExtend.value=newTypeExtendKV,filterAll.push(newTypeExtend)}}_.isEmpty(filterAll)||(filterObj[typeId]=filterAll)}catch(e){console.log(e)}}}return JSON.stringify({class:classes,filters:filterObj})}async function homeVod(){var videos=[];for(const item of JSON.parse(await request(url+"/api.php/Index/getHomePage",{type:1,p:1})).data.video)if(0===item.title.styleType)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){0==pg&&(pg=1);var reqUrl=url+"/api.php/Video/getFilterVideoList",extend=JSON.parse(jinja2(`{
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}}", "type": "{{tid}}",
"p": "{{pg}}", "p": "{{pg}}",
"area": "{{ext.area|default(0)}}", "area": "{{ext.area|default(0)}}",
"year": "{{ext.year|default(0)}}", "year": "{{ext.year|default(0)}}",
"sort": "{{ext.sort|default(0)}}", "sort": "{{ext.sort|default(0)}}",
"class": "{{ext.class|default(0)}}" "class": "{{ext.class|default(0)}}"
}`, }`,{ext:extend,tid:tid,pg:pg})),tid=(console.log(extend),JSON.parse(await request(reqUrl,extend)).data),videos=[];for(const vod of tid.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(tid.current_page),pagecount:parseInt(tid.last_page),limit:parseInt(tid.per_page),total:parseInt(tid.total),list:videos})}async function detail(id){var id=JSON.parse(await request(url+"/api.php/Video/getVideoInfo",{video_id:id})).data.video,vod={vod_id:id.vod_id,vod_name:id.vod_name,vod_pic:id.vod_pic,type_name:id.vod_class,vod_year:id.vod_year,vod_area:id.vod_area,vod_remarks:id.vod_remarks||"",vod_actor:id.vod_actor,vod_director:id.vod_director,vod_content:id.vod_content.trim()},playlist={};for(const item of id.vod_play){var from=item.playerForm;if("jp"!==from&&"xg"!==from){let urls=[];for(const u of item.url)urls.push(formatPlayUrl(vod.vod_name,u.title)+"$"+u.play_url);!playlist.hasOwnProperty(from)&&0<urls.length&&(playlist[from]=urls)}}parse=id.parse||[],vod.vod_play_from=_.keys(playlist).join("$$$");var vod_play_url=[];for(const urlist of _.values(playlist))vod_play_url.push(urlist.join("#"));return vod.vod_play_url=vod_play_url.join("$$$"),JSON.stringify({list:[vod]})}var parse=[];async function play(flag,id,flags){try{if((0<=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<parse.length)for(let index=0;index<parse.length;index++)try{var p=parse[index];let res=await req(p+id,{headers:{"user-agent":"okhttp/4.1.0"}});if((result=jsonParse(id,JSON.parse(res.content))).url)return result.parse=0,JSON.stringify(result)}catch(error){}if(0<=id.indexOf("jqq-")){var jqqHeader=await request(url+"/jqqheader.json",null,null,!0),jqqHeaders=JSON.parse(jqqHeader),ids=id.split("-"),jxJqq=await req("https://api.juquanquanapp.com/app/drama/detail?dramaId="+ids[1]+"&episodeSid="+ids[2]+"&quality=LD",{headers:jqqHeaders}),jqqInfo=JSON.parse(jxJqq.content);if(jqqInfo.data.playInfo.url)return JSON.stringify({parse:0,playUrl:"",url:jqqInfo.data.playInfo.url})}var result,res=await request(url+"/video.php",{url:id});return(result=jsonParse(id,JSON.parse(res).data)).url?(result.parse=0,JSON.stringify(result)):JSON.stringify({parse:0,playUrl:"",url:id})}catch(e){return console.log(e),JSON.stringify({parse:0,url:id})}}async function search(wd,quick){var videos=[];for(const vod of JSON.parse(await request(url+"/api.php/Search/getSearch",{key:wd,type_id:0,p:1})).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})}const charStr="abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789";function randStr(len,withNum){for(var _str="",containsNum=void 0===withNum||withNum,i=0;i<len;i++){var 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,!1).toUpperCase()+_.random(11,99)+randStr(1,!1).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=url.startsWith("//")?"https:"+url:url).startsWith("http"))return{};let headers=json.headers||{};var ua=(json["user-agent"]||"").trim(),referer=(0<ua.length&&(headers["User-Agent"]=ua),(json.referer||"").trim());return 0<referer.length&&(headers.Referer=referer),_.keys(headers).forEach(hk=>{headers[hk]||delete headers[hk]}),{header:headers,url:url}}catch(error){console.log(error)}return{}}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};
{ 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,
};
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,195 @@
// 自动从 地址发布页 获取&跳转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);
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,
};
}

View File

@ -1,7 +1,7 @@
import { Crypto, _ } from './lib/cat.js'; import { Crypto, _ } from './lib/cat.js';
let key = 'mtsp'; let key = 'mtsp';
let main = 'http://mt77.pw'; let main = 'http://mt77.top';
let url = ''; let url = '';
let siteKey = ''; let siteKey = '';
let siteType = 0; let siteType = 0;

File diff suppressed because one or more lines are too long

147
JN/EXT/OPENJS/open/wogg.js Normal file
View File

@ -0,0 +1,147 @@
import {load, _, Uri} from './lib/cat.js';
import {log} from './lib/utils.js';
import {initAli, detailContent, playContent} from './lib/ali.js';
let siteKey = '';
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\/[^"]+)/
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
let ext = '';
if (typeof cfg == 'object') {
siteKey = cfg.skey;
siteType = cfg.stype;
ext = cfg.ext;
} else {
ext = cfg; //适配影视
}
await initAli(ext);
}
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) {
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);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return '';
}
async function play(flag, id, flags) {
return await playContent(flag, id, flags);
}
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,
};
}

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};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
JN/EXT/OPENJS/open/yt.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long