Add files via upload
This commit is contained in:
parent
4e1f437248
commit
22bad8e488
1
cat/ng_open.js
Normal file
1
cat/ng_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/nivod_op.js
Normal file
1
cat/nivod_op.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/nivod_open.js
Normal file
1
cat/nivod_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/panghu_open.js
Normal file
1
cat/panghu_open.js
Normal file
File diff suppressed because one or more lines are too long
150
cat/pansearch_open.js
Normal file
150
cat/pansearch_open.js
Normal file
@ -0,0 +1,150 @@
|
||||
import { load, _ } from 'assets://js/lib/cat.js';
|
||||
import { log } from './lib/utils.js';
|
||||
import { initAli, detailContent, playContent } from './lib/ali.js';
|
||||
|
||||
let siteKey = 'pansearch';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://www.pansearch.me';
|
||||
let patternAli = /(https:\/\/www\.aliyundrive\.com\/s\/[^"]+)/
|
||||
|
||||
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 requestRaw(reqUrl, headers) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: headers || {
|
||||
'User-Agent': UA,
|
||||
'Referer': siteUrl,
|
||||
},
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
async function request(reqUrl) {
|
||||
let resRaw = await requestRaw(reqUrl)
|
||||
return resRaw.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
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 home(filter) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function homeVod() {}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
try {
|
||||
let matches = id.match(patternAli);
|
||||
if (!_.isEmpty(matches)) return await detailContent(matches[0]);
|
||||
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, pg) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const limit = 10;
|
||||
let offsetParam = '';
|
||||
const offset = (pg - 1) * limit;
|
||||
if (offset > 0) {
|
||||
offsetParam = '&offset=' + offset;
|
||||
}
|
||||
const html = await request(siteUrl);
|
||||
const $ = load(html);
|
||||
const script = $('script#__NEXT_DATA__')[0];
|
||||
const data = script.children[0].data;
|
||||
const buildId = JSON.parse(data).buildId;
|
||||
const url = siteUrl + "/_next/data/" + buildId + "/search.json?keyword=" + encodeURIComponent(wd) + offsetParam + "&pan=aliyundrive";
|
||||
const result = await requestRaw(url, getSearchHeader());
|
||||
const json = JSON.parse(result.content).pageProps.data;
|
||||
const total = json.total;
|
||||
const videoIdSet = new Set();
|
||||
const videos = [];
|
||||
for (const item of json.data) {
|
||||
const content = item.content;
|
||||
const img = item.image || siteUrl + "/favicon.png";
|
||||
const splits = content.split('\n');
|
||||
if (_.isEmpty(splits)) continue;
|
||||
if (content.includes('1、')) {
|
||||
for (const line of splits) {
|
||||
if (_.isEmpty(line)) continue;
|
||||
const vodId = parseVideo(line, videoIdSet);
|
||||
if (!vodId) continue;
|
||||
videos.push({
|
||||
vod_id: vodId,
|
||||
vod_name: line.replaceAll(/<\/?[^>]+>/g, "").replace(/[0-9]*、/g, '').replace(/:http.*/g, ''),
|
||||
vod_pic: img,
|
||||
vod_remarks: item.time
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const vodId = parseVideo(content, videoIdSet);
|
||||
if (!vodId) continue;
|
||||
videos.push({
|
||||
vod_id: vodId,
|
||||
vod_name: splits[0].replaceAll(/<\/?[^>]+>/g, "").replace('名称:', ''),
|
||||
vod_pic: img,
|
||||
vod_remarks: item.time
|
||||
});
|
||||
}
|
||||
}
|
||||
const pgCount = parseInt(total / limit) + 1;
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: limit,
|
||||
total: total,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
function parseVideo(content, videoIdSet) {
|
||||
const matches = content.match(patternAli);
|
||||
if (_.isEmpty(matches)) return;
|
||||
const vodId = matches[1];
|
||||
if (videoIdSet.has(vodId)) return;
|
||||
videoIdSet.add(vodId);
|
||||
return vodId;
|
||||
}
|
||||
|
||||
function getSearchHeader() {
|
||||
return {
|
||||
"x-nextjs-data": "1",
|
||||
"Referer": siteUrl,
|
||||
};
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
123
cat/pansou_open.js
Normal file
123
cat/pansou_open.js
Normal file
@ -0,0 +1,123 @@
|
||||
import { load, _ } from 'assets://js/lib/cat.js';
|
||||
import { log } from './lib/utils.js';
|
||||
import { initAli, detailContent, playContent } from './lib/ali.js';
|
||||
|
||||
let siteKey = 'pansou';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://www.alipansou.com';
|
||||
let patternAli = /(https:\/\/www\.aliyundrive\.com\/s\/[^"]+)/
|
||||
|
||||
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 requestRaw(reqUrl, headers, redirect) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: headers || {
|
||||
'User-Agent': UA,
|
||||
'Referer': siteUrl,
|
||||
},
|
||||
redirect: redirect,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
async function request(reqUrl) {
|
||||
let resRaw = await requestRaw(reqUrl)
|
||||
return resRaw.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
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 home(filter) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function homeVod() {}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
try {
|
||||
let matches = id.match(patternAli);
|
||||
if (!_.isEmpty(matches)) return await detailContent(matches[0]);
|
||||
let url = siteUrl + id.replace("/s/", "/cv/");
|
||||
const data = await requestRaw(url, getHeaders(id), 0);
|
||||
const headers = data.headers;
|
||||
const resp = data.content;
|
||||
if (headers.hasOwnProperty('location')) {
|
||||
url = headers['location'].replace('/redirect?visit=', 'https://www.aliyundrive.com/s/');
|
||||
return await detailContent(url);
|
||||
} else if (!_.isEmpty(resp)) {
|
||||
const $ = load(resp);
|
||||
url = $('a:first').attr('href').replace('/redirect?visit=', 'https://www.aliyundrive.com/s/');
|
||||
return await detailContent(url);
|
||||
}
|
||||
return '';
|
||||
} catch (e) {
|
||||
await log('detail:' + e.message + ' line:' + e.lineNumber);
|
||||
}
|
||||
}
|
||||
|
||||
function getHeaders(id) {
|
||||
return {
|
||||
"User-Agent": UA,
|
||||
"Referer": siteUrl + id,
|
||||
"_bid": "6d14a5dd6c07980d9dc089a693805ad8",
|
||||
};
|
||||
}
|
||||
|
||||
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, pg) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const limit = 10;
|
||||
const html = await request(siteUrl + "/search?k=" + encodeURIComponent(wd) + "&page=" + pg + "&s=0&t=-1");
|
||||
const $ = load(html);
|
||||
const items = $('van-row > a');
|
||||
const videos = _.map(items, (item) => {
|
||||
let title = $(item).find('template:first').text().trim();
|
||||
return {
|
||||
vod_id: item.attribs.href,
|
||||
vod_name: title,
|
||||
vod_pic: 'https://inews.gtimg.com/newsapp_bt/0/13263837859/1000',
|
||||
};
|
||||
});
|
||||
const pageCount = $('van-pagination').attr('page-count') || pg;
|
||||
const pgCount = parseInt(pageCount);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: limit,
|
||||
total: limit * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
1
cat/rbk_open.js
Normal file
1
cat/rbk_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/rbzj_open.js
Normal file
1
cat/rbzj_open.js
Normal file
File diff suppressed because one or more lines are too long
135
cat/sharenice_open.js
Normal file
135
cat/sharenice_open.js
Normal file
@ -0,0 +1,135 @@
|
||||
// 搜索滑块验证
|
||||
import { load, _ } from './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 + '#.mp4';
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
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,
|
||||
};
|
||||
}
|
1
cat/sssp_open.js
Normal file
1
cat/sssp_open.js
Normal file
File diff suppressed because one or more lines are too long
182
cat/subaibai_open.js
Normal file
182
cat/subaibai_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/tutu_open.js
Normal file
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
135
cat/tuxiaobei_open.js
Normal 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
118
cat/ubestkid_open.js
Normal 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,
|
||||
}
|
||||
}
|
1
cat/ufc_open.js
Normal file
1
cat/ufc_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/voflix_open.js
Normal file
1
cat/voflix_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/vsdj_open.js
Normal file
1
cat/vsdj_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/wf_open.js
Normal file
1
cat/wf_open.js
Normal file
File diff suppressed because one or more lines are too long
155
cat/wobg.js
Normal file
155
cat/wobg.js
Normal file
@ -0,0 +1,155 @@
|
||||
import {load, _, Uri} from './lib/cat.js';
|
||||
import {log} from './lib/utils.js';
|
||||
import {initAli, detailContent, playContent} from './lib/ali.js';
|
||||
|
||||
let siteKey = 'wobg';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://wobge.run.goorm.io';
|
||||
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': 2, 'type_name' : '自营剧集'},{'type_id': 3, 'type_name' : '动漫'},{'type_id': 4, 'type_name' : '综艺'},{'type_id': 5, 'type_name' : '音乐'},{'type_id': 44, '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/vod/show/id/'+tid+'/page/'+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/vod/search.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/wogg.js
Normal file
1
cat/wogg.js
Normal file
File diff suppressed because one or more lines are too long
155
cat/wogg_open.js
Normal file
155
cat/wogg_open.js
Normal file
@ -0,0 +1,155 @@
|
||||
import {load, _, Uri} from './lib/cat.js';
|
||||
import {log} from './lib/utils.js';
|
||||
import {initAli, detailContent, playContent} from './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': 2, 'type_name' : '电视剧'},{'type_id': 6, 'type_name' : '短剧'},{'type_id': 3, 'type_name' : '动漫'},{'type_id': 4, 'type_name' : '综艺'},{'type_id': 5, '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/wpian_open.js
Normal file
1
cat/wpian_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/xiaoya.js
Normal file
1
cat/xiaoya.js
Normal 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/xiaoya_open.js
Normal file
1
cat/xiaoya_open.js
Normal file
File diff suppressed because one or more lines are too long
114
cat/xiaozhitiao_open.js
Normal file
114
cat/xiaozhitiao_open.js
Normal file
@ -0,0 +1,114 @@
|
||||
import { load, _ } from 'assets://js/lib/cat.js';
|
||||
import { log } from './lib/utils.js';
|
||||
import { initAli, detailContent, playContent } from './lib/ali.js';
|
||||
|
||||
let siteKey = 'xiaozhitiao';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://gitcafe.net/tool/alipaper/';
|
||||
let aliUrl = "https://www.aliyundrive.com/s/";
|
||||
let token = '';
|
||||
let date = new Date();
|
||||
|
||||
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, data) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'User-Agent': UA,
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
data: data,
|
||||
postType: 'form',
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
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 home(filter) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function homeVod() {}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
try {
|
||||
return await detailContent(id);
|
||||
} 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, pg) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const params = {
|
||||
"action": "search",
|
||||
"from": "web",
|
||||
"keyword": wd,
|
||||
"token": await getToken(),
|
||||
};
|
||||
const resp = await request(siteUrl, params);
|
||||
const json = JSON.parse(resp);
|
||||
if (!json.success) return "";
|
||||
const videos = _.map(json.data, (item) => {
|
||||
return {
|
||||
vod_id: aliUrl + item.alikey,
|
||||
vod_name: item.title,
|
||||
vod_pic: "https://www.lgstatic.com/i/image2/M01/15/7E/CgoB5lysLXCADg6ZAABapAHUnQM321.jpg",
|
||||
vod_remarks: item.creatime
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function getToken() {
|
||||
const newDate = new Date();
|
||||
if (_.isEmpty(token) || newDate > date) {
|
||||
const params = {
|
||||
"action": "get_token",
|
||||
};
|
||||
const resp = await request(siteUrl, params);
|
||||
const json = JSON.parse(resp);
|
||||
if (json.success) {
|
||||
token = json.data;
|
||||
date = newDate;
|
||||
}
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
243
cat/yjys_open.js
Normal file
243
cat/yjys_open.js
Normal file
@ -0,0 +1,243 @@
|
||||
<?php
|
||||
//管理员应急工具箱
|
||||
error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);
|
||||
define('DIR',dirname(__DIR__));
|
||||
define('config_path', DIR . '/data/ATool_config.php'); ;
|
||||
|
||||
//判断配置文件是否存在
|
||||
if(is_file(config_path)){
|
||||
require config_path;
|
||||
if(empty($config['key'])){
|
||||
exit('未读取到Key');
|
||||
}
|
||||
require DIR."/system/Msg.php";
|
||||
}else{
|
||||
require DIR.'/system/public.php';
|
||||
Reset_Config();
|
||||
}
|
||||
|
||||
//switch状态
|
||||
if($config['switch'] === 1){
|
||||
|
||||
}else{
|
||||
$msg['title'] = 'ATool未开启';
|
||||
$msg['methodTitle'] = '开启方式:';
|
||||
$msg['content'] = '1. 登录您的云服务器或虚拟主机<br /> 2. 进入TwoNav的程序目录<br /> 3. 编辑 data/ATool_config.php 将"switch" => 0 改为 "switch" => 1 <br /> 4. 复制Key的内容,保存后刷新此页面,使用Key验证即可进入ATool';
|
||||
require DIR.'/templates/admin/other/error.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
session_name('ATool_SSID');
|
||||
session_start();
|
||||
|
||||
if(!empty($_GET['type'])){
|
||||
if($_GET['type'] == 'verify'){
|
||||
if(isset($_SESSION['verify']) && $_SESSION['verify'] === true){
|
||||
msg(-1,'您已经验证过了,无需重复验证!');
|
||||
}else{
|
||||
if(!empty($_POST['Key']) && $_POST['Key'] === md5($config['key'])){
|
||||
$_SESSION['verify'] = true;
|
||||
msg(1,'验证成功');
|
||||
}else{
|
||||
msg(-1,'Key错误');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否已验证
|
||||
if(isset($_SESSION['verify']) && $_SESSION['verify'] === true){
|
||||
$db = Load_db();
|
||||
$global_config = unserialize( get_db("global_config", "v", ["k" => "o_config"]) );
|
||||
}else{
|
||||
msg(-1,'鉴权失败');
|
||||
}
|
||||
|
||||
if($_GET['type'] == 'logout'){
|
||||
$_SESSION['verify'] = false;
|
||||
Reset_Config();
|
||||
msg(1,'退出成功');
|
||||
}elseif($_GET['type'] == 'user_list'){
|
||||
$query = $_POST['query'];
|
||||
$UserGroup = @$_POST['UserGroup'];
|
||||
$page = empty(intval($_REQUEST['page'])) ? 1 : intval($_REQUEST['page']);
|
||||
$limit = empty(intval($_REQUEST['limit'])) ? 50 : intval($_REQUEST['limit']);
|
||||
$offset = ($page - 1) * $limit; //起始行号
|
||||
//用户组筛选
|
||||
if(!empty($UserGroup)){
|
||||
$where['AND']['UserGroup'] = $UserGroup;
|
||||
}
|
||||
//关键字筛选
|
||||
if(!empty($query)){
|
||||
$where['AND']['OR'] = ["User[~]" => $query,"Email[~]" => $query,"RegIP[~]" => $query];
|
||||
}
|
||||
//统计条数
|
||||
$count = count_db('global_user',$where);
|
||||
//权重排序(数字小的排前面)
|
||||
$where['ORDER']['RegTime'] = 'DESC';
|
||||
//分页
|
||||
$where['LIMIT'] = [$offset,$limit];
|
||||
//查询
|
||||
$datas = select_db('global_user',['ID','User','UserGroup','Email','RegIP','RegTime','Login'],$where);
|
||||
if(!empty($datas)){
|
||||
$user_group = select_db('user_group',['name','code'],'');//读用户组
|
||||
$user_group = array_column($user_group, 'name', 'code');//以代号为键
|
||||
$user_group['root'] = '站长';
|
||||
$user_group['default'] = '默认';
|
||||
foreach ($datas as $key => $data){
|
||||
$datas[$key]['UserGroupName'] = $user_group[$data['UserGroup']]??'Null';
|
||||
}
|
||||
}
|
||||
msgA(['code'=>1,'msg'=>'获取成功','count'=>$count,'data'=>$datas]);
|
||||
}elseif($_GET['type'] == 'set_pwd'){
|
||||
if(!has_db('global_user',['ID'=>$_POST['ID']])){
|
||||
msg(-1,'用户不存在!');
|
||||
}
|
||||
//空字符串md5 防止意外出现空密码
|
||||
if( $_POST['new_pwd']== 'd41d8cd98f00b204e9800998ecf8427e'){
|
||||
msg(-1,'密码不能为空');
|
||||
}
|
||||
$RegTime = get_db('global_user','RegTime',['ID'=>$_POST['ID']]);
|
||||
update_db('global_user',['Password'=>Get_MD5_Password($_POST['new_pwd'],$RegTime)],["ID" => $_POST['ID'] ],[1,'修改成功']);
|
||||
}elseif($_GET['type'] == 'set_root'){
|
||||
update_db('global_user',['UserGroup'=>'root'],["ID" => $_POST['ID'] ],[1,'修改成功']);
|
||||
//设为允许注册
|
||||
}elseif($_GET['type'] == 'set_allow_register'){
|
||||
$global_config['RegOption'] = 1;
|
||||
update_db("global_config", ["v" => $global_config], ["k" => "o_config"],[1,'设置成功']);
|
||||
//关闭维护模式
|
||||
}elseif($_GET['type'] == 'set_close_Maintenance'){
|
||||
$global_config['Maintenance'] = 0;
|
||||
update_db("global_config", ["v" => $global_config], ["k" => "o_config"],[1,'设置成功']);
|
||||
//重置静态路径
|
||||
}elseif($_GET['type'] == 'Set_Libs'){
|
||||
$global_config['Libs'] = "./static";
|
||||
update_db("global_config", ["v" => $global_config], ["k" => "o_config"],[1,'设置成功']);
|
||||
//清理缓存
|
||||
}elseif($_GET['type'] == 'Set_clear_cache'){
|
||||
clearstatcache();
|
||||
if(function_exists("opcache_reset")){
|
||||
opcache_reset(); //清理PHP缓存
|
||||
}
|
||||
msgA(['code'=>1,'msg'=>'操作成功']);
|
||||
//改账号
|
||||
}elseif($_GET['type'] == 'set_user_name'){
|
||||
//新用户名是否合规
|
||||
if(empty($_POST['new_user_name'])){
|
||||
msgA(['code'=>-1,'msg'=>'用户名不能为空']);
|
||||
}elseif(empty($_POST['ID'])){
|
||||
msgA(['code'=>-1,'msg'=>'ID不能为空']);
|
||||
}elseif(!preg_match('/^[A-Za-z0-9]{4,13}$/',$_POST['new_user_name'])){
|
||||
msg(-1,'账号只能是4到13位的数字和字母!');
|
||||
}
|
||||
|
||||
//检测是否冲突
|
||||
if(file_exists(DIR."/data/user/".$_POST['new_user_name'])){
|
||||
msgA(['code'=>-1,'msg'=>'data/user/存在同名文件夹']);
|
||||
}
|
||||
if(file_exists(DIR."/data/backup/".$_POST['new_user_name'])){
|
||||
msgA(['code'=>-1,'msg'=>'data/backup/存在同名文件夹']);
|
||||
}
|
||||
//读取用户信息
|
||||
$USER = get_db("global_user", "*", ["ID" => $_POST['ID']]);
|
||||
if(empty($USER)){
|
||||
msgA(['code'=>-1,'msg'=>'用户ID不存在']);
|
||||
}elseif($USER['User'] == $_POST['new_user_name']){
|
||||
msgA(['code'=>-1,'msg'=>'新用户名不能和旧的一样']);
|
||||
}elseif(has_db('global_user',['User'=>$_POST['new_user_name']])){
|
||||
msgA(['code'=>-1,'msg'=>'新账号已存在,请核对后再试!']);
|
||||
}
|
||||
//移动数据目录
|
||||
$Path = DIR.'/data/user/'.$USER['User'];
|
||||
if(is_dir($Path)){
|
||||
$New_Path = DIR.'/data/user/'.$_POST['new_user_name'];
|
||||
if(!rename($Path,$New_Path)){
|
||||
msgA(['code'=>-1,'msg'=>'移动数据目录失败']);
|
||||
}
|
||||
}
|
||||
//移动备份目录
|
||||
$Path = DIR.'/data/backup/'.$USER['User'];
|
||||
if(is_dir($Path)){
|
||||
$New_Path = DIR.'/data/backup/'.$_POST['new_user_name'];
|
||||
if(!rename($Path,$New_Path)){
|
||||
msgA(['code'=>-1,'msg'=>'移动备份目录失败']);
|
||||
}
|
||||
}
|
||||
update_db("user_login_info", ["user" => $_POST['new_user_name']], ["user" => $USER['User']]);
|
||||
update_db("user_log", ["user" => $_POST['new_user_name']], ["user" => $USER['User']]);
|
||||
update_db("global_user", ["User" => $_POST['new_user_name']], ["ID" => $_POST['ID']],[1,'操作成功']);
|
||||
}elseif($_GET['type'] == 'del_otp'){
|
||||
$user_data = get_db('global_user','*',['ID'=>$_POST['ID']]);
|
||||
$LoginConfig = unserialize($user_data['LoginConfig']);
|
||||
if(empty($LoginConfig['totp_key'])){
|
||||
msgA(['code'=>-1,'msg'=>'当前账号未开启OTP双重验证']);
|
||||
}
|
||||
$LoginConfig['totp_key'] = '';
|
||||
update_db("global_user", ["LoginConfig" => $LoginConfig], ["ID" => $_POST['ID']],[1,'操作成功']);
|
||||
}
|
||||
|
||||
msgA(['code'=>-1,'msg'=>'请求类型错误']);
|
||||
}else{
|
||||
//判断是否已验证
|
||||
if(isset($_SESSION['verify']) && $_SESSION['verify'] === true){
|
||||
$db = Load_db();
|
||||
$global_config = unserialize( get_db("global_config", "v", ["k" => "o_config"]) );
|
||||
echo_Atool();
|
||||
}else{
|
||||
echo_verify();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//载入数据库
|
||||
function Load_db(){
|
||||
require DIR."/data/config.php";
|
||||
require DIR.'/system/Medoo.php';
|
||||
if($db_config['type'] == 'sqlite'){
|
||||
try {
|
||||
$db_config['path'] = DIR."/data/".$db_config['file'];
|
||||
$db = new Medoo\Medoo(['type'=>'sqlite','database'=>$db_config['path']]);
|
||||
}catch (Exception $e) {
|
||||
Amsg(-1,'载入数据库失败'.$db_config['path']);
|
||||
}
|
||||
}elseif($db_config['type'] == 'mysql'){
|
||||
try {
|
||||
$db = new Medoo\Medoo(['type' => 'mysql',
|
||||
'host' => $db_config['host'],
|
||||
'port' => $db_config['port'],
|
||||
'database' => $db_config['name'],
|
||||
'username' => $db_config['user'],
|
||||
'password' => $db_config['password']
|
||||
]);
|
||||
}catch (Exception $e) {
|
||||
Amsg(-1,'链接数据库失败!');
|
||||
}
|
||||
}
|
||||
require DIR.'/system/public.php';
|
||||
return $db;
|
||||
}
|
||||
|
||||
function echo_Atool(){
|
||||
global $global_config;
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ATool 工具箱</title>
|
||||
<link rel="stylesheet" href="../static/Layui/v2.8.17/css/layui.css">
|
||||
<style>
|
||||
html, body {min-width: 1200px;background-color: #fff;position: relative;}
|
||||
.page-wrapper {width: 1200px;margin: 0 auto;padding: 0 15px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-wrapper">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend> ATool 工具箱 </legend>
|
||||
</fieldset>
|
||||
<div class="layui-btn-container" style="display: inline-block;">
|
||||
<button id="logout" class="layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon layui-icon-snowflake"></i>安全退出</button>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" href="../index.php?c=<?php echo $global_config['Login'];?>" target="_blank"><i class="layui-icon layui-icon-username"></i>打开登录页</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary" href="../index.php?c=<?php ec
|
1
cat/ym_open.js
Normal file
1
cat/ym_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/yqktv_open.js
Normal file
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
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
1
cat/yrzj_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/yzys_open.js
Normal file
1
cat/yzys_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/yzz_open.js
Normal file
1
cat/yzz_open.js
Normal file
File diff suppressed because one or more lines are too long
1
cat/zjm_open.js
Normal file
1
cat/zjm_open.js
Normal file
File diff suppressed because one or more lines are too long
258
cat/zxzj_open.js
Normal file
258
cat/zxzj_open.js
Normal file
@ -0,0 +1,258 @@
|
||||
// 自动从 地址发布页 获取&跳转url地址
|
||||
import { Crypto, load, _ } from './lib/cat.js';
|
||||
|
||||
let key = '在线之家';
|
||||
let HOST = 'https://www.zxzj.site'; // 地址发布页
|
||||
let host = '';
|
||||
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;
|
||||
const html = await request(HOST);
|
||||
const $ = load(html);
|
||||
host = $('div.content-top > ul > li').find('a:first')[0].attribs.href;
|
||||
console.debug('在线之家 跳转地址 =====>' + host); // js_debug.log
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
const html = await request(host);
|
||||
const $ = load(html);
|
||||
const class_parse = $('ul.stui-header__menu > li > a[href*=list]');
|
||||
let 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,
|
||||
};
|
||||
});
|
||||
const filterObj = {
|
||||
1: [{ 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: '冒险' }] }, { 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: '其他' }] }],
|
||||
2: [{ 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: '其他' }] }],
|
||||
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: '其他' }] }],
|
||||
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: '其他' }] }],
|
||||
6: [{ 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: '其他' }] }]
|
||||
};
|
||||
let filYer = { 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' }] };
|
||||
filYer['init'] = filYer.value[0].v;
|
||||
let filBy = { key: 'by', name: '排序', value: [{ n: '时间', v: 'time' }, { n: '人气', v: 'hits' }, { n: '评分', v: 'score' }] };
|
||||
filBy['init'] = filBy.value[0].v;
|
||||
return JSON.stringify({
|
||||
class: _.map(classes, (cls) => {
|
||||
if (filterObj[cls.type_id]) {
|
||||
filterObj[cls.type_id].push(filYer, filBy);
|
||||
filterObj[cls.type_id][0]['init'] = filterObj[cls.type_id][0].value[0].v;
|
||||
} else {
|
||||
filterObj[cls.type_id] = [];
|
||||
filterObj[cls.type_id].push(filYer, filBy)
|
||||
}
|
||||
return cls;
|
||||
}),
|
||||
filters: filterObj,
|
||||
});
|
||||
}
|
||||
|
||||
async function homeVod() {
|
||||
const link = host + '/vodshow/1--hits---------2023.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const js2Base = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||
const items = $('ul.stui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const a = $(item).find('a:first')[0];
|
||||
const 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: js2Base + base64Encode(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;
|
||||
const link = host + '/vodshow/' + 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 js2Base = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||
const items = $('ul.stui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const a = $(item).find('a:first')[0];
|
||||
const 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: js2Base + base64Encode(a.attribs['data-original']),
|
||||
vod_remarks: remarks || '',
|
||||
};
|
||||
});
|
||||
const hasMore = $('ul.stui-page__item > 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(host + '/detail/' + id + '.html');
|
||||
const $ = load(html);
|
||||
const js2Base = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||
const 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_director: $('.stui-content__detail p:nth-child(4)').text().replace('导演:', ''),
|
||||
vod_pic: js2Base + base64Encode($('.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(),
|
||||
};
|
||||
let playMap = {};
|
||||
const tabs = $('div.stui-vodlist__head > h3');
|
||||
const playlists = $('ul.stui-content__playlist');
|
||||
_.each(tabs, (tab, i) => {
|
||||
const from = tab.children[0].data;
|
||||
let list = playlists[i];
|
||||
list = $(list).find('a');
|
||||
_.each(list, (it) => {
|
||||
const title = it.children[0].data;
|
||||
const 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('$$$');
|
||||
const urls = _.values(playMap);
|
||||
let 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) {
|
||||
const html = await request(host + id);
|
||||
const mhtml = html.match(/r player_.*?=(.*?)</)[1];
|
||||
const json = JSON.parse(mhtml);
|
||||
const url = json.url;
|
||||
const from = json.from;
|
||||
if (json.encrypt == '1') {
|
||||
url = unescape(url)
|
||||
} else if (json.encrypt == '2') {
|
||||
url = unescape(base64Decode(url))
|
||||
}
|
||||
if (url.indexOf('m3u8') >= 0 || url.indexOf('mp4') >= 0) {
|
||||
// console.debug('在线之家url =====>' + url); // js_debug.log
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: url,
|
||||
});
|
||||
} else if (from.indexOf('line3') >= 0 || from.indexOf('line5') >= 0) {
|
||||
const ifrwy = await request(url);
|
||||
const code = ifrwy.match(/var url = '(.*?)'/)[1].split('').reverse().join('');
|
||||
let temp = '';
|
||||
for (let i = 0x0; i < code.length; i = i + 0x2) {
|
||||
temp += String.fromCharCode(parseInt(code[i] + code[i + 0x1], 0x10))
|
||||
}
|
||||
const purl = temp.substring(0x0, (temp.length - 0x7) / 0x2) + temp.substring((temp.length - 0x7) / 0x2 + 0x7);
|
||||
// console.debug('在线之家purl =====>' + purl); // js_debug.log
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: purl,
|
||||
});
|
||||
} else {
|
||||
// console.debug('在线之家url =====>' + '空'); // js_debug.log
|
||||
return '{}';
|
||||
}
|
||||
}
|
||||
|
||||
async function search(wd, quick) {
|
||||
var data = JSON.parse(await request(host + '/index.php/ajax/suggest?mid=1&wd=' + wd + '&limit=50')).list;
|
||||
const js2Base = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||
let videos = _.map(data, (it) => {
|
||||
return {
|
||||
vod_id: it.id,
|
||||
vod_name: it.name,
|
||||
vod_pic: js2Base + base64Encode(it.pic),
|
||||
vod_remarks: '',
|
||||
}
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
limit: 50,
|
||||
});
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
async function proxy(segments, headers) {
|
||||
let what = segments[0];
|
||||
let url = base64Decode(segments[1]);
|
||||
if (what == 'img') {
|
||||
var resp = await req(url, {
|
||||
buffer: 2,
|
||||
headers: {
|
||||
Referer: 'https://api.douban.com/',
|
||||
'User-Agent': MOBILE_UA,
|
||||
},
|
||||
});
|
||||
return JSON.stringify({
|
||||
code: resp.code,
|
||||
buffer: 2,
|
||||
content: resp.content,
|
||||
headers: resp.headers,
|
||||
});
|
||||
}
|
||||
return JSON.stringify({
|
||||
code: 500,
|
||||
content: '',
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
proxy: proxy,
|
||||
search: search,
|
||||
};
|
||||
}
|
1
cat/zz123_book_open.js
Normal file
1
cat/zz123_book_open.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user