Add files via upload
This commit is contained in:
parent
8801128cf9
commit
6381c2cdcf
253
JN/EXT/OPENJS/open/230ts_open.js
Normal file
253
JN/EXT/OPENJS/open/230ts_open.js
Normal file
@ -0,0 +1,253 @@
|
||||
// 网站搜索异常
|
||||
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 {
|
||||
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.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 = {
|
||||
vod_id: id,
|
||||
vod_name: $('h1:first').text().trim().replace('有声小说',''),
|
||||
vod_pic: HOST + $('div.myui-content__thumb img:first').attr('data-original'),
|
||||
vod_content: $('div.ellipsis').text().trim(),
|
||||
};
|
||||
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');
|
||||
});
|
||||
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 {
|
||||
vod_id: it.attribs.href.replace(/.*?\/tingshu\/(.*)/g, '$1'),
|
||||
vod_name: it.attribs.title.replace('有声小说',''),
|
||||
vod_pic: img.attribs['data-original'],
|
||||
vod_remarks: remarks.replace('佚名(著)','').replace('佚名(播)','').replace('未知(著)','').replace('未知(播)','') || '',
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
@ -1,240 +1,244 @@
|
||||
import { Crypto, load, _ } from './lib/cat.js';
|
||||
|
||||
let key = 'czzy';
|
||||
let url = 'https://cz4k.com';
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
|
||||
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
||||
|
||||
const cookie = {};
|
||||
|
||||
async function request(reqUrl, referer, mth, data, hd) {
|
||||
const headers = {
|
||||
'User-Agent': UA,
|
||||
Cookie: _.map(cookie, (value, key) => {
|
||||
return `${key}=${value}`;
|
||||
}).join(';'),
|
||||
};
|
||||
if (referer) headers.referer = encodeURIComponent(referer);
|
||||
let res = await req(reqUrl, {
|
||||
method: mth || 'get',
|
||||
headers: headers,
|
||||
data: data,
|
||||
postType: mth === 'post' ? 'form' : '',
|
||||
});
|
||||
if (res.headers['set-cookie']) {
|
||||
const set_cookie = _.isArray(res.headers['set-cookie']) ? res.headers['set-cookie'].join(';') : res.headers['set-cookie'];
|
||||
const cks = set_cookie.split(';');
|
||||
for (const c of cks) {
|
||||
const tmp = c.trim();
|
||||
if (tmp.startsWith('result=')) {
|
||||
cookie.result = tmp.substring(7);
|
||||
return await request(reqUrl, reqUrl, 'post', {
|
||||
result: cookie.result,
|
||||
});
|
||||
} else if (tmp.startsWith('esc_search_captcha=1')) {
|
||||
cookie.esc_search_captcha = 1;
|
||||
delete cookie.result;
|
||||
return await request(reqUrl);
|
||||
}
|
||||
}
|
||||
// console.log(res.headers['set-cookie']);
|
||||
}
|
||||
return res.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
let filterObj = {};
|
||||
const html = await request(url + '/movie_bt');
|
||||
const $ = load(html);
|
||||
const series = $('div#beautiful-taxonomy-filters-tax-movie_bt_series > a[cat-url*=movie_bt_series]');
|
||||
const tags = $('div#beautiful-taxonomy-filters-tax-movie_bt_tags > a');
|
||||
let tag = {
|
||||
key: 'tag',
|
||||
name: '类型',
|
||||
value: _.map(tags, (n) => {
|
||||
let v = n.attribs['cat-url'] || '';
|
||||
v = v.substring(v.lastIndexOf('/') + 1);
|
||||
return { n: n.children[0].data, v: v };
|
||||
}),
|
||||
};
|
||||
tag['init'] = tag.value[0].v;
|
||||
let classes = _.map(series, (s) => {
|
||||
let typeId = s.attribs['cat-url'];
|
||||
typeId = typeId.substring(typeId.lastIndexOf('/') + 1);
|
||||
filterObj[typeId] = [tag];
|
||||
return {
|
||||
type_id: typeId,
|
||||
type_name: s.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() {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const tag = extend.tag || '';
|
||||
const link = url + '/movie_bt' + (tag.length > 0 ? `/movie_bt_tags/${tag}` : '') + '/movie_bt_series/' + tid + (pg > 1 ? `/page/${pg}` : '');
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.mrb > ul > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const img = $(item).find('img:first')[0];
|
||||
const a = $(item).find('a:first')[0];
|
||||
const hdinfo = $($(item).find('div.hdinfo')[0]).text().trim();
|
||||
const jidi = $($(item).find('div.jidi')[0]).text().trim();
|
||||
return {
|
||||
vod_id: a.attribs.href.replace(/.*?\/movie\/(.*).html/g, '$1'),
|
||||
vod_name: img.attribs.alt,
|
||||
vod_pic: img.attribs['data-original'],
|
||||
vod_remarks: jidi || hdinfo || '',
|
||||
};
|
||||
});
|
||||
const hasMore = $('div.mrb > div.pagenavi_txt > a:contains(>)').length > 0;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 20,
|
||||
total: 20 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
function stripHtmlTag(src) {
|
||||
return src
|
||||
.replace(/<\/?[^>]+(>|$)/g, '')
|
||||
.replace(/&.{1,5};/g, '')
|
||||
.replace(/\s{2,}/g, ' ');
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
const html = await request(url + '/movie/' + id + '.html');
|
||||
const $ = load(html);
|
||||
const detail = $('ul.moviedteail_list > li');
|
||||
let vod = {
|
||||
vod_id: id,
|
||||
vod_pic: $('div.dyimg img:first').attr('src'),
|
||||
vod_remarks: '',
|
||||
vod_content: stripHtmlTag($('div.yp_context').html()).trim(),
|
||||
};
|
||||
for (const info of detail) {
|
||||
const i = $(info).text().trim();
|
||||
if (i.startsWith('地区:')) {
|
||||
vod.vod_area = i.substring(3);
|
||||
} else if (i.startsWith('年份:')) {
|
||||
vod.vod_year = i.substring(3);
|
||||
} else if (i.startsWith('导演:')) {
|
||||
vod.vod_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_lang = i.substring(3);
|
||||
}
|
||||
}
|
||||
const playlist = _.map($('div.paly_list_btn > a'), (a) => {
|
||||
return a.children[0].data + '$' + a.attribs.href.replace(/.*?\/v_play\/(.*).html/g, '$1');
|
||||
});
|
||||
vod.vod_play_from = key;
|
||||
vod.vod_play_url = playlist.join('#');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
const link = url + '/v_play/' + id + '.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const iframe = $('body iframe[src*=Cloud]');
|
||||
if (iframe.length > 0) {
|
||||
const iframeHtml = (
|
||||
await req(iframe[0].attribs.src, {
|
||||
headers: {
|
||||
Referer: link,
|
||||
'User-Agent': UA,
|
||||
},
|
||||
})
|
||||
).content;
|
||||
let code = iframeHtml
|
||||
.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 playUrl = temp.substring(0x0, (temp.length - 0x7) / 0x2) + temp.substring((temp.length - 0x7) / 0x2 + 0x7);
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
});
|
||||
} else {
|
||||
const js = $('script:contains(window.wp_nonce)').html();
|
||||
const group = js.match(/(var.*)eval\((\w*\(\w*\))\)/);
|
||||
const md5 = Crypto;
|
||||
const result = eval(group[1] + group[2]);
|
||||
const playUrl = result.match(/url:.*?['"](.*?)['"]/)[1];
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function search(wd, quick) {
|
||||
const html = await request(url + '/?s=' + wd);
|
||||
const $ = load(html);
|
||||
const items = $('div.search_list > ul > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const img = $(item).find('img:first')[0];
|
||||
const a = $(item).find('a:first')[0];
|
||||
const hdinfo = $($(item).find('div.hdinfo')[0]).text().trim();
|
||||
const jidi = $($(item).find('div.jidi')[0]).text().trim();
|
||||
return {
|
||||
vod_id: a.attribs.href.replace(/.*?\/movie\/(.*).html/g, '$1'),
|
||||
vod_name: img.attribs.alt,
|
||||
vod_pic: img.attribs['data-original'],
|
||||
vod_remarks: jidi || hdinfo || '',
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
||||
// 自动从 地址发布页 获取&跳转url地址
|
||||
import { Crypto, load, _ } from './lib/cat.js';
|
||||
|
||||
let key = 'czzy';
|
||||
let host = 'https://www.czzy.site'; // 厂长地址发布页
|
||||
// let url = 'https://cz01.cc';
|
||||
let url = '';
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
||||
const cookie = {};
|
||||
|
||||
async function request(reqUrl, referer, mth, data, hd) {
|
||||
const headers = {
|
||||
'User-Agent': UA,
|
||||
Cookie: _.map(cookie, (value, key) => {
|
||||
return `${key}=${value}`;
|
||||
}).join(';'),
|
||||
};
|
||||
if (referer) headers.referer = encodeURIComponent(referer);
|
||||
let res = await req(reqUrl, {
|
||||
method: mth || 'get',
|
||||
headers: headers,
|
||||
data: data,
|
||||
postType: mth === 'post' ? 'form' : '',
|
||||
});
|
||||
if (res.headers['set-cookie']) {
|
||||
const set_cookie = _.isArray(res.headers['set-cookie']) ? res.headers['set-cookie'].join(';') : res.headers['set-cookie'];
|
||||
const cks = set_cookie.split(';');
|
||||
for (const c of cks) {
|
||||
const tmp = c.trim();
|
||||
if (tmp.startsWith('result=')) {
|
||||
cookie.result = tmp.substring(7);
|
||||
return await request(reqUrl, reqUrl, 'post', {
|
||||
result: cookie.result,
|
||||
});
|
||||
} else if (tmp.startsWith('esc_search_captcha=1')) {
|
||||
cookie.esc_search_captcha = 1;
|
||||
delete cookie.result;
|
||||
return await request(reqUrl);
|
||||
}
|
||||
}
|
||||
// console.log(res.headers['set-cookie']);
|
||||
}
|
||||
return res.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
let html = await request(host);
|
||||
url = html.match(/推荐访问<a href="(.*)"/)[1];
|
||||
console.debug('厂长跳转地址 =====>' + url); // js_debug.log
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
let filterObj = {};
|
||||
const html = await request(url + '/movie_bt');
|
||||
const $ = load(html);
|
||||
const tags = $('div#beautiful-taxonomy-filters-tax-movie_bt_tags > a');
|
||||
let tag = {
|
||||
key: 'tag',
|
||||
name: '类型',
|
||||
value: _.map(tags, (n) => {
|
||||
let v = n.attribs['cat-url'] || '';
|
||||
v = v.substring(v.lastIndexOf('/') + 1);
|
||||
return { n: n.children[0].data, v: v };
|
||||
}),
|
||||
};
|
||||
tag['init'] = tag.value[0].v;
|
||||
const series = $('div#beautiful-taxonomy-filters-tax-movie_bt_series > a[cat-url*=movie_bt_series]');
|
||||
let classes = _.map(series, (s) => {
|
||||
let typeId = s.attribs['cat-url'];
|
||||
typeId = typeId.substring(typeId.lastIndexOf('/') + 1);
|
||||
filterObj[typeId] = [tag];
|
||||
return {
|
||||
type_id: typeId,
|
||||
type_name: s.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() {
|
||||
return '{}';
|
||||
}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const tag = extend.tag || '';
|
||||
const link = url + '/movie_bt' + (tag.length > 0 ? `/movie_bt_tags/${tag}` : '') + '/movie_bt_series/' + tid + (pg > 1 ? `/page/${pg}` : '');
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.mrb > ul > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const img = $(item).find('img:first')[0];
|
||||
const a = $(item).find('a:first')[0];
|
||||
const hdinfo = $($(item).find('div.hdinfo')[0]).text().trim();
|
||||
const jidi = $($(item).find('div.jidi')[0]).text().trim();
|
||||
return {
|
||||
vod_id: a.attribs.href.replace(/.*?\/movie\/(.*).html/g, '$1'),
|
||||
vod_name: img.attribs.alt,
|
||||
vod_pic: img.attribs['data-original'],
|
||||
vod_remarks: jidi || hdinfo || '',
|
||||
};
|
||||
});
|
||||
const hasMore = $('div.mrb > div.pagenavi_txt > a:contains(>)').length > 0;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 20,
|
||||
total: 20 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
function stripHtmlTag(src) {
|
||||
return src
|
||||
.replace(/<\/?[^>]+(>|$)/g, '')
|
||||
.replace(/&.{1,5};/g, '')
|
||||
.replace(/\s{2,}/g, ' ');
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
const html = await request(url + '/movie/' + id + '.html');
|
||||
const $ = load(html);
|
||||
const detail = $('ul.moviedteail_list > li');
|
||||
let vod = {
|
||||
vod_id: id,
|
||||
vod_pic: $('div.dyimg img:first').attr('src'),
|
||||
vod_remarks: '',
|
||||
vod_content: stripHtmlTag($('div.yp_context').html()).trim(),
|
||||
};
|
||||
for (const info of detail) {
|
||||
const i = $(info).text().trim();
|
||||
if (i.startsWith('地区:')) {
|
||||
vod.vod_area = i.substring(3);
|
||||
} else if (i.startsWith('年份:')) {
|
||||
vod.vod_year = i.substring(3);
|
||||
} else if (i.startsWith('导演:')) {
|
||||
vod.vod_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_lang = i.substring(3);
|
||||
}
|
||||
}
|
||||
const playlist = _.map($('div.paly_list_btn > a'), (a) => {
|
||||
return a.children[0].data + '$' + a.attribs.href.replace(/.*?\/v_play\/(.*).html/g, '$1');
|
||||
});
|
||||
vod.vod_play_from = key;
|
||||
vod.vod_play_url = playlist.join('#');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
const link = url + '/v_play/' + id + '.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const iframe = $('body iframe[src*=Cloud]');
|
||||
if (iframe.length > 0) {
|
||||
const iframeHtml = (
|
||||
await req(iframe[0].attribs.src, {
|
||||
headers: {
|
||||
Referer: link,
|
||||
'User-Agent': UA,
|
||||
},
|
||||
})
|
||||
).content;
|
||||
let code = iframeHtml
|
||||
.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 playUrl = temp.substring(0x0, (temp.length - 0x7) / 0x2) + temp.substring((temp.length - 0x7) / 0x2 + 0x7);
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
});
|
||||
} else {
|
||||
const js = $('script:contains(window.wp_nonce)').html();
|
||||
const group = js.match(/(var.*)eval\((\w*\(\w*\))\)/);
|
||||
const md5 = Crypto;
|
||||
const result = eval(group[1] + group[2]);
|
||||
const playUrl = result.match(/url:.*?['"](.*?)['"]/)[1];
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function search(wd, quick) {
|
||||
const html = await request(url + '/?s=' + wd);
|
||||
const $ = load(html);
|
||||
const items = $('div.search_list > ul > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const img = $(item).find('img:first')[0];
|
||||
const a = $(item).find('a:first')[0];
|
||||
const hdinfo = $($(item).find('div.hdinfo')[0]).text().trim();
|
||||
const jidi = $($(item).find('div.jidi')[0]).text().trim();
|
||||
return {
|
||||
vod_id: a.attribs.href.replace(/.*?\/movie\/(.*).html/g, '$1'),
|
||||
vod_name: img.attribs.alt,
|
||||
vod_pic: img.attribs['data-original'],
|
||||
vod_remarks: jidi || hdinfo || '',
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
||||
|
@ -1,166 +1,173 @@
|
||||
import { Crypto, load, _, jinja2 } from './lib/cat.js';
|
||||
|
||||
let key = 'duboku';
|
||||
let url = 'https://u.duboku.io';
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
|
||||
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
||||
|
||||
async function request(reqUrl, agentSp) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'User-Agent': agentSp || UA,
|
||||
'Referer': url
|
||||
},
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
const html = await request(url);
|
||||
const $ = load(html);
|
||||
const class_parse = $('ul.nav-list > li > a[href*=vodtype]');
|
||||
let classes = [];
|
||||
classes = _.map(class_parse, (cls) => {
|
||||
let typeId = cls.attribs['href'];
|
||||
typeId = typeId.substring(typeId.lastIndexOf('/') + 1).replace('.html','');
|
||||
return {
|
||||
type_id: typeId,
|
||||
type_name: cls.children[0].data,
|
||||
};
|
||||
});
|
||||
let filterObj = {
|
||||
"2":[{"key":"cateId","name":"类型","value":[{"n":"全部","v":"2"},{"n":"陆剧","v":"13"},{"n":"日韩剧","v":"15"},{"n":"短剧","v":"21"},{"n":"台泰剧","v":"14"},{"n":"港剧","v":"20"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"美国","v":"美国"},{"n":"英国","v":"英国"},{"n":"巴西","v":"巴西"},{"n":"泰国","v":"泰国"},{"n":"法国","v":"法国"},{"n":"日本","v":"日本"},{"n":"荷兰","v":"荷兰"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"韩语","v":"韩语"},{"n":"泰语","v":"泰语"},{"n":"法语","v":"法语"},{"n":"日语","v":"日语"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"3":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"真人秀","v":"真人秀"},{"n":"选秀","v":"选秀"},{"n":"竞演","v":"竞演"},{"n":"情感","v":"情感"},{"n":"访谈","v":"访谈"},{"n":"播报","v":"播报"},{"n":"旅游","v":"旅游"},{"n":"音乐","v":"音乐"},{"n":"美食","v":"美食"},{"n":"纪实","v":"纪实"},{"n":"曲艺","v":"曲艺"},{"n":"生活","v":"生活"},{"n":"游戏互动","v":"游戏互动"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"韩国","v":"韩国"},{"n":"美国","v":"美国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"4":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"玄幻","v":"玄幻"},{"n":"武侠","v":"武侠"},{"n":"情感","v":"情感"},{"n":"科幻","v":"科幻"},{"n":"热血","v":"热血"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":"冒险"},{"n":"萝莉","v":"萝莉"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":"社会","v":"社会"},{"n":"亲子","v":"亲子"},{"n":"益智","v":"益智"},{"n":"励志","v":"励志"},{"n":"其他","v":"其他"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"国产","v":"国产"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"法国","v":"法国"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"13":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"15":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"21":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"14":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"台湾","v":"台湾"},{"n":"泰国","v":"泰国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"20":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}]
|
||||
};
|
||||
|
||||
return JSON.stringify({
|
||||
class: classes,
|
||||
filters: filterObj,
|
||||
});
|
||||
}
|
||||
|
||||
async function homeVod() {
|
||||
const link = url + '/vodshow/2--hits---------.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const it = $(item).find('a:first')[0];
|
||||
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
|
||||
return {
|
||||
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
|
||||
vod_name: it.attribs.title,
|
||||
vod_pic: it.attribs['data-original'],
|
||||
vod_remarks: remarks || '',
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0) pg = 1;
|
||||
|
||||
const link = url + '/vodshow/' + (extend.CateId || tid) + '-'+(extend.area || '')+'-'+(extend.by || 'time')+'-'+(extend.class || '')+'-'+(extend.lang || '')+'-'+(extend.letter || '')+'---' + (`${pg}`) + '---'+(extend.year || '')+'.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const it = $(item).find('a:first')[0];
|
||||
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
|
||||
return {
|
||||
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
|
||||
vod_name: it.attribs.title,
|
||||
vod_pic: it.attribs['data-original'],
|
||||
vod_remarks: remarks || '',
|
||||
};
|
||||
});
|
||||
const hasMore = $('ul.myui-page > li > a:contains(下一页)').length > 0;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 24,
|
||||
total: 24 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
const html = await request(url + '/voddetail/' + id + '.html');
|
||||
const $ = load(html);
|
||||
let vod = {
|
||||
vod_id: id,
|
||||
vod_name: $('h1:first').text().trim(),
|
||||
vod_type: $('.myui-content__detail p:first a').text(),
|
||||
vod_actor: $('.myui-content__detail p:nth-child(5)').text().replace('主演:',''),
|
||||
vod_director: $('.myui-content__detail p:nth-child(6)').text().replace('导演:',''),
|
||||
vod_pic: $('div.myui-content__thumb img:first').attr('data-original'),
|
||||
vod_remarks :$('#rating:first span').text().replace(/\s{2,}/g, ' '),
|
||||
vod_content: $('span.data').text().trim(),
|
||||
};
|
||||
const playlist = _.map($('ul.sort-list > li > a'), (it) => {
|
||||
return it.children[0].data + '$' + it.attribs.href.replace(/\/vodplay\/(.*).html/g, '$1');
|
||||
});
|
||||
vod.vod_play_from = key;
|
||||
vod.vod_play_url = playlist.join('#');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
const link = url + '/vodplay/' + id + '.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const js = JSON.parse($('script:contains(player_)').html().replace('var player_data=',''));
|
||||
const playUrl = js.url.replace('index.m3u8','hls\/index.m3u8');
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
});
|
||||
}
|
||||
|
||||
async function search(wd, quick) {
|
||||
let data = JSON.parse(await request(url + '/index.php/ajax/suggest?mid=1&wd=' + wd)).list;
|
||||
let videos = [];
|
||||
for (const vod of data) {
|
||||
videos.push({
|
||||
vod_id: vod.id,
|
||||
vod_name: vod.name,
|
||||
vod_pic: vod.pic,
|
||||
vod_remarks: '',
|
||||
});
|
||||
}
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
// 修复 Windows版 播放转圈圈
|
||||
import { load, _ } from './lib/cat.js';
|
||||
|
||||
let key = 'duboku';
|
||||
let HOST = 'https://www.duboku.tv';
|
||||
// let HOST = 'https://u.duboku.io';
|
||||
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);
|
||||
const $ = load(html);
|
||||
const class_parse = $('ul.nav-list > li > a[href*=vodtype]');
|
||||
let classes = [];
|
||||
classes = _.map(class_parse, (cls) => {
|
||||
let typeId = cls.attribs['href'];
|
||||
typeId = typeId.substring(typeId.lastIndexOf('/') + 1).replace('.html','');
|
||||
return {
|
||||
type_id: typeId,
|
||||
type_name: cls.children[0].data,
|
||||
};
|
||||
});
|
||||
let filterObj = {
|
||||
"2":[{"key":"cateId","name":"类型","value":[{"n":"全部","v":"2"},{"n":"陆剧","v":"13"},{"n":"日韩剧","v":"15"},{"n":"短剧","v":"21"},{"n":"台泰剧","v":"14"},{"n":"港剧","v":"20"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"美国","v":"美国"},{"n":"英国","v":"英国"},{"n":"巴西","v":"巴西"},{"n":"泰国","v":"泰国"},{"n":"法国","v":"法国"},{"n":"日本","v":"日本"},{"n":"荷兰","v":"荷兰"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"韩语","v":"韩语"},{"n":"泰语","v":"泰语"},{"n":"法语","v":"法语"},{"n":"日语","v":"日语"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"3":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"真人秀","v":"真人秀"},{"n":"选秀","v":"选秀"},{"n":"竞演","v":"竞演"},{"n":"情感","v":"情感"},{"n":"访谈","v":"访谈"},{"n":"播报","v":"播报"},{"n":"旅游","v":"旅游"},{"n":"音乐","v":"音乐"},{"n":"美食","v":"美食"},{"n":"纪实","v":"纪实"},{"n":"曲艺","v":"曲艺"},{"n":"生活","v":"生活"},{"n":"游戏互动","v":"游戏互动"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"韩国","v":"韩国"},{"n":"美国","v":"美国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"4":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"玄幻","v":"玄幻"},{"n":"武侠","v":"武侠"},{"n":"情感","v":"情感"},{"n":"科幻","v":"科幻"},{"n":"热血","v":"热血"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":"冒险"},{"n":"萝莉","v":"萝莉"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":"社会","v":"社会"},{"n":"亲子","v":"亲子"},{"n":"益智","v":"益智"},{"n":"励志","v":"励志"},{"n":"其他","v":"其他"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"国产","v":"国产"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"法国","v":"法国"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"13":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"15":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"21":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"14":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"台湾","v":"台湾"},{"n":"泰国","v":"泰国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}],
|
||||
"20":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"悬疑","v":"悬疑"},{"n":"武侠","v":"武侠"},{"n":"科幻","v":"科幻"},{"n":"都市","v":"都市"},{"n":"爱情","v":"爱情"},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春","v":"青春"},{"n":"偶像","v":"偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"乡村","v":"乡村"},{"n":"年代","v":"年代"},{"n":"警匪","v":"警匪"},{"n":"谍战","v":"谍战"},{"n":"冒险","v":"冒险"},{"n":"罪案","v":"罪案"},{"n":"宫廷","v":"宫廷"},{"n":"BL","v":"BL"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}]
|
||||
};
|
||||
|
||||
return JSON.stringify({
|
||||
class: classes,
|
||||
filters: filterObj,
|
||||
});
|
||||
}
|
||||
|
||||
async function homeVod() {
|
||||
const link = HOST + '/vodshow/2--hits---------.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const it = $(item).find('a:first')[0];
|
||||
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
|
||||
return {
|
||||
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
|
||||
vod_name: it.attribs.title,
|
||||
vod_pic: it.attribs['data-original'],
|
||||
vod_remarks: remarks || '',
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0) pg = 1;
|
||||
const link = HOST + '/vodshow/' + (extend.CateId || tid) + '-'+(extend.area || '')+'-'+(extend.by || 'time')+'-'+(extend.class || '')+'-'+(extend.lang || '')+'-'+(extend.letter || '')+'---' + (`${pg}`) + '---'+(extend.year || '')+'.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const items = $('div.myui-panel_bd > ul.myui-vodlist > li');
|
||||
let videos = _.map(items, (item) => {
|
||||
const it = $(item).find('a:first')[0];
|
||||
const remarks = $($(item).find('span.pic-text')[0]).text().trim();
|
||||
return {
|
||||
vod_id: it.attribs.href.replace(/.*?\/voddetail\/(.*).html/g, '$1'),
|
||||
vod_name: it.attribs.title,
|
||||
vod_pic: it.attribs['data-original'],
|
||||
vod_remarks: remarks || '',
|
||||
};
|
||||
});
|
||||
const hasMore = $('ul.myui-page > li > a:contains(下一页)').length > 0;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 24,
|
||||
total: 24 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
const html = await request(HOST + '/voddetail/' + id + '.html');
|
||||
const $ = load(html);
|
||||
let vod = {
|
||||
vod_id: id,
|
||||
vod_name: $('h1:first').text().trim(),
|
||||
vod_type: $('.myui-content__detail p:first a').text(),
|
||||
vod_actor: $('.myui-content__detail p:nth-child(5)').text().replace('主演:',''),
|
||||
vod_director: $('.myui-content__detail p:nth-child(6)').text().replace('导演:',''),
|
||||
vod_pic: $('div.myui-content__thumb img:first').attr('data-original'),
|
||||
vod_remarks :$('#rating:first span').text().replace(/\s{2,}/g, ' '),
|
||||
vod_content: $('span.data').text().trim(),
|
||||
};
|
||||
const playlist = _.map($('ul.sort-list > li > a'), (it) => {
|
||||
return it.children[0].data + '$' + it.attribs.href.replace(/\/vodplay\/(.*).html/g, '$1');
|
||||
});
|
||||
// vod.vod_play_from = key;
|
||||
vod.vod_play_from = '道长在线';
|
||||
vod.vod_play_url = playlist.join('#');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
const link = HOST + '/vodplay/' + id + '.html';
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const js = JSON.parse($('script:contains(player_)').html().replace(/var player_.*=/,''));
|
||||
const playUrl = js.url;
|
||||
let headers = {
|
||||
"referer": HOST+"/static/player/vidjs.html",
|
||||
};
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
header: headers,
|
||||
});
|
||||
}
|
||||
|
||||
async function search(wd, quick) {
|
||||
let data = JSON.parse(await request(HOST + '/index.php/ajax/suggest?mid=1&wd=' + wd + '&limit=50')).list;
|
||||
let videos = [];
|
||||
for (const vod of data) {
|
||||
videos.push({
|
||||
vod_id: vod.id,
|
||||
vod_name: vod.name,
|
||||
vod_pic: vod.pic,
|
||||
vod_remarks: '',
|
||||
});
|
||||
}
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
limit: 50,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
250
JN/EXT/OPENJS/open/mybili_open.js
Normal file
250
JN/EXT/OPENJS/open/mybili_open.js
Normal file
File diff suppressed because one or more lines are too long
213
JN/EXT/OPENJS/open/ng_open.js
Normal file
213
JN/EXT/OPENJS/open/ng_open.js
Normal file
@ -0,0 +1,213 @@
|
||||
import { Crypto, jinja2, _ } from './lib/cat.js';
|
||||
|
||||
let key = '南瓜影视';
|
||||
let HOST = 'http://ys.changmengyun.com';
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
let MOBILE_UA = 'okhttp/4.6.0'
|
||||
|
||||
async function request(reqUrl) {
|
||||
let t = new Date().getTime().toString();
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'version_name': '1.0.6',
|
||||
'version_code': '6',
|
||||
'package_name': 'com.app.nanguatv',
|
||||
'sign': Crypto.MD5('c431ea542cee9679#uBFszdEM0oL0JRn@' + t).toString().toLowerCase(),
|
||||
'imei': 'c431ea542cee9679',
|
||||
'timeMillis': t,
|
||||
'User-Agent': MOBILE_UA
|
||||
},
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
let data = JSON.parse(await request(HOST + '/api.php/provide/home_nav'));
|
||||
let classes = [];
|
||||
for (const key in data) {
|
||||
if (data[key].name != '精选')
|
||||
classes.push({
|
||||
type_id: data[key].id,
|
||||
type_name: data[key].name,
|
||||
});
|
||||
}
|
||||
let filterObj = {
|
||||
"2":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"国产剧","v":"国产剧"},{"n":"港台剧","v":"港台剧"}]},{"key":"area","name":"地区","value":[{"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":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}],
|
||||
"1":[{"key":"class","name":"类型","value":[{"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":"印度"},{"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":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}],
|
||||
"4":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"国产漫","v":"国产漫"},{"n":"欧美漫","v":"欧美漫"},{"n":"日韩漫","v":"日韩漫"},{"n":"港台漫","v":"港台漫"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"中国大陆","v":"中国大陆"},{"n":"日本","v":"日本"},{"n":"韩国","v":"韩国"},{"n":"欧美","v":"欧美"},{"n":"其它","v":"其它"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"新上线","v":"新上线"}]},{"key":"total","name":"状态","value":[{"n":"全部","v":"状态"},{"n":"连载","v":"连载"},{"n":"完结","v":"完结"}]}],
|
||||
"3":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"大陆","v":"大陆"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"内地","v":"内地"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"},{"n":"其它","v":"其它"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"新上线","v":"新上线"}]}],
|
||||
"46":[{"key":"class","name":"类型","value":[{"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":"其他"}]},{"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":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}]
|
||||
};
|
||||
return JSON.stringify({
|
||||
class: classes,
|
||||
filters: filterObj,
|
||||
});
|
||||
}
|
||||
|
||||
async function homeVod() {
|
||||
let data = JSON.parse(await request(HOST + '/api.php/provide/vod_rank?app=ylys&sort_type=month&imei=c431ea542cee9679&id=2&page=1'));
|
||||
let videos = [];
|
||||
data.forEach(function(it) {
|
||||
videos.push({
|
||||
vod_id: it.id,
|
||||
vod_name: it.name,
|
||||
vod_pic: it.img,
|
||||
vod_remarks: it.remarks,
|
||||
});
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
|
||||
let reqUrl = HOST + '/api.php/provide/vod_list?app=ylys&id=' + tid + '&page=' + pg + '&imei=c431ea542cee9679&';
|
||||
reqUrl += jinja2('area={{ext.area}}&year={{ext.year}}&type={{ext.class}}&total={{ext.total}}&order={{ext.by}}', { ext: extend });
|
||||
// let data = JSON.parse(await request(reqUrl));
|
||||
let data = JSON.parse(await request(reqUrl)).list;
|
||||
let videos = [];
|
||||
data.forEach(function(it) {
|
||||
videos.push({
|
||||
vod_id: it.id,
|
||||
vod_name: it.name,
|
||||
vod_pic: it.img,
|
||||
vod_remarks: it.remarks,
|
||||
});
|
||||
});
|
||||
let pgChk = JSON.parse(await request(HOST + '/api.php/provide/vod_list?app=ylys&id=' + tid + '&page=' + (parseInt(pg) + 1) + '&imei=c431ea542cee9679&')).msg;
|
||||
const pgCount = (pgChk == 'ok') ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 20,
|
||||
total: 20 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
let data = JSON.parse(await request(HOST + '/api.php/provide/vod_detail?app=ylys&imei=c431ea542cee9679&id=' + id)).data;
|
||||
let vod = {
|
||||
vod_id: data.id,
|
||||
vod_name: data.name,
|
||||
vod_pic: data.img,
|
||||
type_name: data.type,
|
||||
vod_year: data.year,
|
||||
vod_remarks: '更新至: ' + data.msg + ' / 评分: ' + data.score,
|
||||
vod_content: stripHtmlTag(data.info),
|
||||
};
|
||||
let episodes = data.player_info;
|
||||
let playlist = {};
|
||||
episodes.forEach(function(it) {
|
||||
let playurls = it.video_info;
|
||||
playurls.forEach(function(playurl) {
|
||||
let source = it.show;
|
||||
let t = formatPlayUrl(vod.vod_name, playurl.name);
|
||||
if (t.length == 0) t = playurl.name.trim();
|
||||
if (!playlist.hasOwnProperty(source)) {
|
||||
playlist[source] = [];
|
||||
}
|
||||
playlist[source].push(t + '$' + playurl.url);
|
||||
});
|
||||
});
|
||||
vod.vod_play_from = _.keys(playlist).join('$$$');
|
||||
let urls = _.values(playlist);
|
||||
let vod_play_url = [];
|
||||
urls.forEach(function(it) {
|
||||
vod_play_url.push(it.join('#'));
|
||||
});
|
||||
vod.vod_play_url = vod_play_url.join('$$$');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
try {
|
||||
if (id.indexOf('m3u8') != -1) {
|
||||
let mjurl = id.split('url=')[1]
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: mjurl,
|
||||
});
|
||||
} else if (id.indexOf(',') != -1) {
|
||||
let mjurl = id.split(',')[1]
|
||||
let jData = JSON.parse(await request(mjurl));
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: jData.data.url,
|
||||
});
|
||||
} else {
|
||||
let mjurl = 'http://43.154.104.152:1234/jhapi/cs.php?url=' + id.split('url=')[1]
|
||||
let jData = JSON.parse(await request(mjurl));
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: jData.data.url,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function search(wd, quick, pg) {
|
||||
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
|
||||
let data = JSON.parse(await request(HOST + '/api.php/provide/search_result_more?app=ylys&video_name=' + wd + '&pageSize=20&tid=0&imei=c431ea542cee9679&page=' + pg, 'okhttp/4.6.0')).data;
|
||||
let videos = [];
|
||||
data.forEach(function(it) {
|
||||
videos.push({
|
||||
vod_id: it.id,
|
||||
vod_name: it.video_name,
|
||||
vod_pic: it.img,
|
||||
vod_remarks: it.qingxidu + '/' + it.category,
|
||||
});
|
||||
});
|
||||
let pgChk = JSON.parse(await request(HOST + '/api.php/provide/search_result_more?app=ylys&video_name=' + wd + '&pageSize=20&tid=0&imei=c431ea542cee9679&page=' + (parseInt(pg) + 1), 'okhttp/4.6.0')).msg;
|
||||
const pgCount = (pgChk == 'ok') ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: 20,
|
||||
total: 20 * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
function stripHtmlTag(src) {
|
||||
return src
|
||||
.replace(/<\/?[^>]+(>|$)/g, '')
|
||||
.replace(/&.{1,5};/g, '')
|
||||
.replace(/\s{2,}/g, ' ');
|
||||
}
|
||||
|
||||
function formatPlayUrl(src, name) {
|
||||
return name
|
||||
.trim()
|
||||
.replaceAll(src, '')
|
||||
.replace(/<|>|《|》/g, '')
|
||||
.replace(/\$|#/g, ' ')
|
||||
.trim();
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
182
JN/EXT/OPENJS/open/subaibai_open.js
Normal file
182
JN/EXT/OPENJS/open/subaibai_open.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user