mirror of https://github.com/qist/tvbox.git
parent
e8a866b4bd
commit
a1df95e46b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,183 @@
|
|||||||
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let siteUrl = 'https://4kysxz.top';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
let headers = {};
|
||||||
|
|
||||||
|
async function request(reqUrl, postData, agentSp, get) {
|
||||||
|
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: get ? 'get' : 'post',
|
||||||
|
headers: headers,
|
||||||
|
data: postData || {},
|
||||||
|
postType: get ? '' : 'form',
|
||||||
|
});
|
||||||
|
|
||||||
|
let content = res.content;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
let classes = [{
|
||||||
|
type_id: '16',
|
||||||
|
type_name: '高清电影',
|
||||||
|
},{
|
||||||
|
type_id: '17',
|
||||||
|
type_name: '高清剧集',
|
||||||
|
}];
|
||||||
|
|
||||||
|
//let filterObj = genFilterObj();
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
//filters: filterObj
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
let videos = await getVideos(siteUrl);
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
if (!pg) pg = 1;
|
||||||
|
if (pg <= 0) pg = 1;
|
||||||
|
let url = siteUrl + '/category-' + tid + '_' + pg + '.html';
|
||||||
|
let videos = await getVideos(url);
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
page: pg,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
try {
|
||||||
|
const html = await request(id);
|
||||||
|
const $ = load(html);
|
||||||
|
|
||||||
|
|
||||||
|
let actors = _.map($('div.entry-content.u-text-format.u-clearfix > div:nth-child(10) > div > span > span'), (n) => {
|
||||||
|
return $(n).text().split(' ')[0];
|
||||||
|
});
|
||||||
|
let actor = actors.join(' ');
|
||||||
|
|
||||||
|
let directors = _.map($('div.entry-content.u-text-format.u-clearfix > div:nth-child(8) > div > span'), (n) => {
|
||||||
|
return $(n).text().split(' ')[0];
|
||||||
|
});
|
||||||
|
let director = directors.join(' ');
|
||||||
|
|
||||||
|
let title = $('div.site-content > section > div > header > h1').text().trim();
|
||||||
|
|
||||||
|
let content = '该影视由【Leospring】采集分享';
|
||||||
|
let playUrlStr = '';
|
||||||
|
let playFromStr = '';
|
||||||
|
//高清直播
|
||||||
|
const cards = $('div.entry-content.u-text-format.u-clearfix > custag > ul > li > a');
|
||||||
|
if (cards.length > 0) {
|
||||||
|
let playUrls = _.map(cards, (n) => {
|
||||||
|
let playUrl = n.attribs['href'];
|
||||||
|
if (playUrl.indexOf('url=') > 0) {
|
||||||
|
playUrl = playUrl.split('url=')[1].split('&name')[0];
|
||||||
|
}
|
||||||
|
return $(n).text() + '$' + playUrl;
|
||||||
|
});
|
||||||
|
playUrlStr = playUrls.join('#');
|
||||||
|
playFromStr = '高清直播';
|
||||||
|
}
|
||||||
|
|
||||||
|
//磁力链接
|
||||||
|
const tbs = $('loginshow > table');
|
||||||
|
let playFrom = '';
|
||||||
|
let nameUrls = [];
|
||||||
|
for(let i = 0;i< tbs.length;i++) {
|
||||||
|
if (i%2 == 0) {
|
||||||
|
playFrom = $(tbs[i]).find('tbody > tr >td').text().replaceAll('WEB', '磁力');
|
||||||
|
} else if (i%2 == 1) {
|
||||||
|
const tds = $(tbs[i]).find('tbody > tr >td');
|
||||||
|
let nameUrl = '';
|
||||||
|
for (let j = 0;j < tds.length;j++) {
|
||||||
|
if (j%2 == 0) {
|
||||||
|
nameUrl = $(tds[j]).text().split('.')[0].split(' ')[0];
|
||||||
|
} else if (j%2==1){
|
||||||
|
nameUrl = nameUrl + '$' + $(tds[j]).text().split('【')[0];
|
||||||
|
nameUrls.push(nameUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (playFromStr.length > 0) {
|
||||||
|
playFromStr += '$$$';
|
||||||
|
playUrlStr += '$$$';
|
||||||
|
}
|
||||||
|
playFromStr += playFrom;
|
||||||
|
playUrlStr += nameUrls.join('#');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const video = {
|
||||||
|
vod_actor: actor,
|
||||||
|
vod_play_from: playFromStr,
|
||||||
|
vod_play_url: playUrlStr,
|
||||||
|
vod_director: director,
|
||||||
|
vod_content: content,
|
||||||
|
};
|
||||||
|
const list = [video];
|
||||||
|
const result = { list };
|
||||||
|
return JSON.stringify(result);
|
||||||
|
} catch (e) {
|
||||||
|
//console.log('err', e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let url = siteUrl + '/search.php?q=' + wd
|
||||||
|
//console.log('search url:', url);
|
||||||
|
let videos = await getVideos(url);
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getVideos(url) {
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.row.posts-wrapper >div > article > div.entry-media > div > a')
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['href'];
|
||||||
|
let name = $($(n).find('img')[0]).attr('alt').replaceAll('<strong>','').replaceAll('</strong>', '').split(' ')[0];
|
||||||
|
let pic = $($(n).find('img')[0]).attr('data-src');
|
||||||
|
return {
|
||||||
|
vod_id: id,
|
||||||
|
vod_name: name,
|
||||||
|
vod_pic: pic,
|
||||||
|
vod_remarks: '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return videos;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,144 @@
|
|||||||
|
import { _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'bookan';
|
||||||
|
let url = 'https://api.bookan.com.cn';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
|
||||||
|
async function request(reqUrl, agentSp) {
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
return res.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cfg = {skey: siteKey, ext: extend}
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
return JSON.stringify({
|
||||||
|
class: [
|
||||||
|
{ type_id: '1305', type_name: '少年读物' },
|
||||||
|
{ type_id: '1304', type_name: '儿童文学' },
|
||||||
|
{ type_id: '1320', type_name: '国学经典' },
|
||||||
|
{ type_id: '1306', type_name: '文艺少年' },
|
||||||
|
{ type_id: '1309', type_name: '育儿心经' },
|
||||||
|
{ type_id: '1310', type_name: '心理哲学' },
|
||||||
|
{ type_id: '1307', type_name: '青春励志' },
|
||||||
|
{ type_id: '1312', type_name: '历史小说' },
|
||||||
|
{ type_id: '1303', type_name: '故事会' },
|
||||||
|
{ type_id: '1317', type_name: '音乐戏剧' },
|
||||||
|
{ type_id: '1319', type_name: '相声评书' },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
pg = pg || 1;
|
||||||
|
if (pg == 0) pg = 1;
|
||||||
|
let content = await request(`${url}/voice/book/list?instance_id=25304&page=${pg}&category_id=${tid}&num=24`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
let books = [];
|
||||||
|
for (const book of data.list) {
|
||||||
|
books.push({
|
||||||
|
vod_id: book.id,
|
||||||
|
vod_name: book.name,
|
||||||
|
vod_pic: book.cover,
|
||||||
|
vod_remarks: book.extra.author,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: data.current_page,
|
||||||
|
pagecount: data.last_page,
|
||||||
|
limit: 24,
|
||||||
|
total: data.total,
|
||||||
|
list: books,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
let content = await request(`${url}/voice/album/units?album_id=${id}&page=1&num=200&order=1`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
console.log(JSON.stringify(data));
|
||||||
|
|
||||||
|
let book = {
|
||||||
|
vod_id: id,
|
||||||
|
type_name: '',
|
||||||
|
vod_year: '',
|
||||||
|
vod_area: '',
|
||||||
|
vod_remarks: '',
|
||||||
|
vod_actor: '',
|
||||||
|
vod_director: '',
|
||||||
|
vod_content: '',
|
||||||
|
};
|
||||||
|
let us = _.map(data.list, function (b) {
|
||||||
|
return formatPlayUrl(b.title) + '$' + b.file;
|
||||||
|
}).join('#');
|
||||||
|
book.vod_play_from = '书卷';
|
||||||
|
book.vod_play_url = us;
|
||||||
|
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [book],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPlayUrl(name) {
|
||||||
|
return name
|
||||||
|
.trim()
|
||||||
|
.replace(/<|>|\.《.*?》/g, '. ')
|
||||||
|
.replace(/\$|#/g, ' ')
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function proxy(segments, headers) {}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
pg = pg || 1;
|
||||||
|
if (pg == 0) pg = 1;
|
||||||
|
let content = await request(`https://es.bookan.com.cn/api/v3/voice/book?instanceId=25304&keyword=${wd}&pageNum=${pg}&limitNum=20`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
let books = [];
|
||||||
|
for (const book of data.list) {
|
||||||
|
books.push({
|
||||||
|
vod_id: book.id,
|
||||||
|
vod_name: book.name,
|
||||||
|
vod_pic: book.cover,
|
||||||
|
vod_remarks: book.extra.author,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: data.current_page,
|
||||||
|
pagecount: data.last_page,
|
||||||
|
limit: 20,
|
||||||
|
total: data.total,
|
||||||
|
list: books,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
import { _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'bookkan';
|
||||||
|
let url = 'https://api.bookan.com.cn';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
|
||||||
|
async function request(reqUrl, agentSp) {
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
return res.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cfg = {skey: siteKey, ext: extend}
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
return JSON.stringify({
|
||||||
|
class: [
|
||||||
|
{ type_id: '1305', type_name: '少年读物' },
|
||||||
|
{ type_id: '1304', type_name: '儿童文学' },
|
||||||
|
{ type_id: '1320', type_name: '国学经典' },
|
||||||
|
{ type_id: '1306', type_name: '文艺少年' },
|
||||||
|
{ type_id: '1309', type_name: '育儿心经' },
|
||||||
|
{ type_id: '1310', type_name: '心理哲学' },
|
||||||
|
{ type_id: '1307', type_name: '青春励志' },
|
||||||
|
{ type_id: '1312', type_name: '历史小说' },
|
||||||
|
{ type_id: '1303', type_name: '故事会' },
|
||||||
|
{ type_id: '1317', type_name: '音乐戏剧' },
|
||||||
|
{ type_id: '1319', type_name: '相声评书' },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
pg = pg || 1;
|
||||||
|
if (pg == 0) pg = 1;
|
||||||
|
let content = await request(`${url}/voice/book/list?instance_id=25304&page=${pg}&category_id=${tid}&num=24`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
let books = [];
|
||||||
|
for (const book of data.list) {
|
||||||
|
books.push({
|
||||||
|
book_id: book.id,
|
||||||
|
book_name: book.name,
|
||||||
|
book_pic: book.cover,
|
||||||
|
book_remarks: book.extra.author,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: data.current_page,
|
||||||
|
pagecount: data.last_page,
|
||||||
|
limit: 24,
|
||||||
|
total: data.total,
|
||||||
|
list: books,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
let content = await request(`${url}/voice/album/units?album_id=${id}&page=1&num=200&order=1`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
|
||||||
|
let book = {
|
||||||
|
audio: 1,
|
||||||
|
book_id: id,
|
||||||
|
type_name: '',
|
||||||
|
book_year: '',
|
||||||
|
book_area: '',
|
||||||
|
book_remarks: '',
|
||||||
|
book_actor: '',
|
||||||
|
book_director: '',
|
||||||
|
book_content: '',
|
||||||
|
};
|
||||||
|
let us = _.map(data.list, function (b) {
|
||||||
|
return formatPlayUrl(b.title) + '$' + b.file;
|
||||||
|
}).join('#');
|
||||||
|
book.volumes = '书卷';
|
||||||
|
book.urls = us;
|
||||||
|
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [book],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPlayUrl(name) {
|
||||||
|
return name
|
||||||
|
.trim()
|
||||||
|
.replace(/<|>|《|》/g, '')
|
||||||
|
.replace(/\$|#/g, ' ')
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function proxy(segments, headers) {}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
pg = pg || 1;
|
||||||
|
if (pg == 0) pg = 1;
|
||||||
|
let content = await request(`https://es.bookan.com.cn/api/v3/voice/book?instanceId=25304&keyword=${wd}&pageNum=${pg}&limitNum=20`);
|
||||||
|
let data = JSON.parse(content).data;
|
||||||
|
let books = [];
|
||||||
|
for (const book of data.list) {
|
||||||
|
books.push({
|
||||||
|
book_id: book.id,
|
||||||
|
book_name: book.name,
|
||||||
|
book_pic: book.cover,
|
||||||
|
book_remarks: book.extra.author,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: data.current_page,
|
||||||
|
pagecount: data.last_page,
|
||||||
|
limit: 20,
|
||||||
|
total: data.total,
|
||||||
|
list: books,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,261 @@
|
|||||||
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'ikanbot';
|
||||||
|
let url = 'https://www.ikanbot.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';
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getClass($) {
|
||||||
|
const nav = $('ul.nav-pills:eq(1) > li > a');
|
||||||
|
let tags = {
|
||||||
|
key: 'tag',
|
||||||
|
name: '标签',
|
||||||
|
value: _.map(nav, (n) => {
|
||||||
|
return { n: n.children[0].data, v: n.attribs.href };
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
tags['init'] = tags.value[0].v;
|
||||||
|
const title = $('title:first').text().split('-')[0].substring(2);
|
||||||
|
return { cls: { type_id: tags.value[0].v, type_name: title }, tags: [tags] };
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
let classes = [];
|
||||||
|
let filterObj = {};
|
||||||
|
for (const cate of ['/hot/index-movie-热门.html', '/hot/index-tv-热门.html']) {
|
||||||
|
const html = await request(url + cate);
|
||||||
|
const $ = load(html);
|
||||||
|
const { cls, tags } = getClass($);
|
||||||
|
classes.push(cls);
|
||||||
|
filterObj[cls.type_id] = tags;
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
filters: filterObj,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('div.v-list a.item');
|
||||||
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
|
let videos = _.map(items, (item) => {
|
||||||
|
const img = $(item).find('img:first')[0];
|
||||||
|
return {
|
||||||
|
vod_id: item.attribs.href,
|
||||||
|
vod_name: img.attribs.alt,
|
||||||
|
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
||||||
|
vod_remarks: '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
if (pg <= 0) pg = 1;
|
||||||
|
const link = url + (extend.tag || tid).replace('.html', pg > 1 ? `-p-${pg}.html` : '.html');
|
||||||
|
const html = await request(link);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('div.v-list a.item');
|
||||||
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
|
let videos = _.map(items, (item) => {
|
||||||
|
const img = $(item).find('img:first')[0];
|
||||||
|
return {
|
||||||
|
vod_id: item.attribs.href,
|
||||||
|
vod_name: img.attribs.alt,
|
||||||
|
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
||||||
|
vod_remarks: '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const hasMore = $('div.page-more > 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 + id);
|
||||||
|
const $ = load(html);
|
||||||
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
|
const detail = $('div.detail');
|
||||||
|
const remarks = $('span#line-tips').text();
|
||||||
|
let vod = {
|
||||||
|
vod_id: id,
|
||||||
|
vod_pic: jsBase + base64Encode($('div.item-root > img')[0].attribs['data-src']),
|
||||||
|
vod_remarks: '',
|
||||||
|
vod_content: remarks || '',
|
||||||
|
vod_name: $(detail).find('h2').text().trim(),
|
||||||
|
vod_year: $(detail).find('h3:nth-child(3)').text(),
|
||||||
|
vod_area: $(detail).find('h3:nth-child(4)').text(),
|
||||||
|
vod_actor: $(detail).find('h3:nth-child(5)').text(),
|
||||||
|
};
|
||||||
|
const res = await req(url + '/api/getResN?videoId=' + id.substring(id.lastIndexOf('/') + 1) + '&mtype=2&token=9109590b194731fde643ce27924fcf6f', {
|
||||||
|
headers: {
|
||||||
|
Referer: 'play',
|
||||||
|
'User-Agent': UA,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const list = JSON.parse(res.content).data.list;
|
||||||
|
let playlist = {};
|
||||||
|
let arr = []
|
||||||
|
for (const l of list) {
|
||||||
|
const flagData = JSON.parse(l.resData);
|
||||||
|
for (const f of flagData) {
|
||||||
|
const from = f.flag;
|
||||||
|
const urls = f.url;
|
||||||
|
if (!from || !urls) continue;
|
||||||
|
if (playlist[from]) continue;
|
||||||
|
playlist[from] = urls;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var key in playlist) {
|
||||||
|
if ('kuaikan' == key) {
|
||||||
|
arr.push({
|
||||||
|
flag: '快看',
|
||||||
|
url: playlist[key],
|
||||||
|
sort: 1
|
||||||
|
})
|
||||||
|
} else if ('bfzym3u8' == key) {
|
||||||
|
arr.push({
|
||||||
|
flag: '暴风',
|
||||||
|
url: playlist[key],
|
||||||
|
sort: 2
|
||||||
|
})
|
||||||
|
} else if ('ffm3u8' == key) {
|
||||||
|
arr.push({
|
||||||
|
flag: '非凡',
|
||||||
|
url: playlist[key],
|
||||||
|
sort: 3
|
||||||
|
})
|
||||||
|
} else if ('lzm3u8' == key) {
|
||||||
|
arr.push({
|
||||||
|
flag: '量子',
|
||||||
|
url: playlist[key],
|
||||||
|
sort: 4
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
arr.push({
|
||||||
|
flag: key,
|
||||||
|
url: playlist[key],
|
||||||
|
sort: 5
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arr.sort((a, b) => a.sort - b.sort);
|
||||||
|
let playFrom = [];
|
||||||
|
let playList = [];
|
||||||
|
arr.map(val => {
|
||||||
|
playFrom.push(val.flag);
|
||||||
|
playList.push(val.url);
|
||||||
|
})
|
||||||
|
vod.vod_play_from = playFrom.join("$$$");
|
||||||
|
vod.vod_play_url = playList.join("$$$");
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [vod],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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: url,
|
||||||
|
'User-Agent': UA,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
code: resp.code,
|
||||||
|
buffer: 2,
|
||||||
|
content: resp.content,
|
||||||
|
headers: resp.headers,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
code: 500,
|
||||||
|
content: '',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
|
||||||
|
const html = await request(url + '/search?q=' + wd + '&p=' + pg);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('div.media');
|
||||||
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
|
let videos = _.map(items, (item) => {
|
||||||
|
const a = $(item).find('a:first')[0];
|
||||||
|
const img = $(item).find('img:first')[0];
|
||||||
|
const remarks = $($(item).find('span.label')[0]).text().trim();
|
||||||
|
return {
|
||||||
|
vod_id: a.attribs.href,
|
||||||
|
vod_name: img.attribs.alt,
|
||||||
|
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
||||||
|
vod_remarks: remarks || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const hasMore = $('div.page-more > a:contains(下一页)').length > 0;
|
||||||
|
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||||
|
return JSON.stringify({
|
||||||
|
page: parseInt(pg),
|
||||||
|
pagecount: pgCount,
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
proxy: proxy,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,206 @@
|
|||||||
|
import { Crypto, load, _, dayjs } from './lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'jiohub';
|
||||||
|
let url = 'https://jiohub.top';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
|
||||||
|
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
||||||
|
|
||||||
|
const cookie = {};
|
||||||
|
|
||||||
|
async function request(reqUrl, referer, mth, data, hd) {
|
||||||
|
const headers = {
|
||||||
|
'User-Agent': UA,
|
||||||
|
Cookie: _.map(cookie, (value, key) => {
|
||||||
|
return `${key}=${value}`;
|
||||||
|
}).join(';'),
|
||||||
|
};
|
||||||
|
if (referer) headers.referer = encodeURIComponent(referer);
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: mth || 'get',
|
||||||
|
headers: headers,
|
||||||
|
data: data,
|
||||||
|
postType: mth === 'post' ? 'form' : '',
|
||||||
|
});
|
||||||
|
return res.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cfg = {skey: siteKey, ext: extend}
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const series = $('.nav-list a[href*=/video]');
|
||||||
|
let classes = _.map(series, (s) => {
|
||||||
|
let typeId = s.attribs['href'];
|
||||||
|
let typeName = typeId.match(/\/video\/(.*)\?/)[1];
|
||||||
|
typeName = decodeURIComponent(typeName);
|
||||||
|
return {
|
||||||
|
type_id: typeName,
|
||||||
|
type_name: typeName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
return '{}';
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
let page = pg || 1;
|
||||||
|
if (page == 0) page = 1;
|
||||||
|
const link = url + '/video/' + tid + "?page=" + page + '&size=18';
|
||||||
|
const html = await request(link);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('div.content-body > a');
|
||||||
|
let videos = _.map(items, (item) => {
|
||||||
|
const img = $(item).find('img:first')[0].attribs['src'];
|
||||||
|
const a = item.attribs['href'].match(/\/watch\/(.*)/)[1];
|
||||||
|
const n = ($(item).find('p.card-title')[0]).children[0].data;
|
||||||
|
let speed = ($(item).find('p.item-speed')[0]).children[0].data || '';
|
||||||
|
const score = ($(item).find('p.score')[0]).children[0].data || '';
|
||||||
|
if (speed == tid) speed = '';
|
||||||
|
return {
|
||||||
|
vod_id: a,
|
||||||
|
vod_name: n,
|
||||||
|
vod_pic: img,
|
||||||
|
vod_remarks: speed || score || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let total = 18;
|
||||||
|
const pag = $('ui-pagination');
|
||||||
|
if (pag.length > 0) {
|
||||||
|
try {
|
||||||
|
total = parseInt(pag[0].attribs['total']);
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify({
|
||||||
|
page: page,
|
||||||
|
pagecount: _.ceil(total / 18),
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function stripHtmlTag(src) {
|
||||||
|
return src
|
||||||
|
.replace(/<\/?[^>]+(>|$)/g, '')
|
||||||
|
.replace(/&.{1,5};/g, '')
|
||||||
|
.replace(/\s{2,}/g, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
const html = await request(url + '/watch/' + id);
|
||||||
|
const $ = load(html);
|
||||||
|
const detail = $('div.content-detail > p');
|
||||||
|
let vod = {
|
||||||
|
vod_id: id,
|
||||||
|
vod_content: stripHtmlTag($('div.content-detail span.detail-sketch').html()).trim(),
|
||||||
|
};
|
||||||
|
for (const info of detail) {
|
||||||
|
const i = $(info).text().trim();
|
||||||
|
if (i.startsWith('地区:')) {
|
||||||
|
vod.vod_area = i.substring(3);
|
||||||
|
} else if (i.startsWith('年份:')) {
|
||||||
|
vod.vod_year = i.substring(3);
|
||||||
|
} else if (i.startsWith('类型:')) {
|
||||||
|
vod.vod_type = i.substring(3);
|
||||||
|
} else if (i.startsWith('导演:')) {
|
||||||
|
vod.vod_director = i.substring(3);
|
||||||
|
} else if (i.startsWith('主演:')) {
|
||||||
|
vod.vod_actor = i.substring(3);
|
||||||
|
} else if (i.startsWith('语言:')) {
|
||||||
|
vod.vod_lang = i.substring(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const urls = html.match(/let urls = \"(.*)\";/)[1].replace(/_/g, '/').replace(/-/g, '+');
|
||||||
|
var key = Crypto.enc.Utf8.parse("cf2d1a-6a4d-9ef8");
|
||||||
|
var playlist = Crypto.AES.decrypt(urls, key, { iv: key, padding: Crypto.pad.Pkcs7 });
|
||||||
|
playlist = Crypto.enc.Utf8.stringify(playlist).split('\n');
|
||||||
|
vod.vod_play_from = 'JOJO';
|
||||||
|
vod.vod_play_url = playlist.join('#');
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [vod],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function playPid() {
|
||||||
|
var key = Crypto.enc.Utf8.parse('VSmJTRRE'+dayjs().format('YYYYMMDD'));
|
||||||
|
var iv = Crypto.enc.Hex.parse("00000000000000000000000000000000");
|
||||||
|
var pid = Crypto.AES.encrypt(dayjs().format('YYYY-MM-DD HH:mm'), key, { iv: iv, padding: Crypto.pad.Pkcs7 });
|
||||||
|
pid = pid.toString().replace(/\+/g, '-');
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id + '?pid=' + playPid(),
|
||||||
|
header: {
|
||||||
|
'User-Agent': UA,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let page = pg || 1;
|
||||||
|
if (page == 0) page = 1;
|
||||||
|
const link = url + '/video/search?q=' + wd + "&page=" + page + '&size=18&pid=' + playPid();
|
||||||
|
const html = await request(link);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('div.content-body > a');
|
||||||
|
let videos = _.map(items, (item) => {
|
||||||
|
const img = $(item).find('img:first')[0].attribs['src'];
|
||||||
|
const a = item.attribs['href'].match(/\/watch\/(.*)/)[1];
|
||||||
|
const n = ($(item).find('p.card-title')[0]).children[0].data;
|
||||||
|
let speed = ($(item).find('p.item-speed')[0]).children[0].data || '';
|
||||||
|
const score = ($(item).find('p.score')[0]).children[0].data || '';
|
||||||
|
if (speed == '电影') speed = '';
|
||||||
|
return {
|
||||||
|
vod_id: a,
|
||||||
|
vod_name: n,
|
||||||
|
vod_pic: img,
|
||||||
|
vod_remarks: speed || score || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let total = 18;
|
||||||
|
const pag = $('ui-pagination');
|
||||||
|
if (pag.length > 0) {
|
||||||
|
try {
|
||||||
|
total = parseInt(pag[0].attribs['total']);
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify({
|
||||||
|
page: page,
|
||||||
|
pagecount: _.ceil(total / 18),
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,346 @@
|
|||||||
|
import { Crypto, dayjs, jinja2, Uri, _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'kunyu77';
|
||||||
|
let url = 'http://api.tyun77.cn';
|
||||||
|
let device = {};
|
||||||
|
let timeOffset = 0;
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
|
||||||
|
async function request(reqUrl, agentSp) {
|
||||||
|
let sj = dayjs().unix() - timeOffset;
|
||||||
|
let uri = new Uri(reqUrl);
|
||||||
|
uri.addQueryParam('pcode', '010110005');
|
||||||
|
uri.addQueryParam('version', '2.1.6');
|
||||||
|
uri.addQueryParam('devid', device.id);
|
||||||
|
uri.addQueryParam('package', 'com.sevenVideo.app.android');
|
||||||
|
uri.addQueryParam('sys', 'android');
|
||||||
|
uri.addQueryParam('sysver', device.release);
|
||||||
|
uri.addQueryParam('brand', device.brand);
|
||||||
|
uri.addQueryParam('model', device.model.replaceAll(' ', '_'));
|
||||||
|
uri.addQueryParam('sj', sj);
|
||||||
|
let keys = [];
|
||||||
|
for (var i = 0; i < uri.queryPairs.length; i++) {
|
||||||
|
keys.push(uri.queryPairs[i][0]);
|
||||||
|
}
|
||||||
|
keys = _.sortBy(keys, function (name) {
|
||||||
|
return name;
|
||||||
|
});
|
||||||
|
let tkSrc = uri.path();
|
||||||
|
for (let k of keys) {
|
||||||
|
let v = uri.getQueryParamValue(k);
|
||||||
|
v = encodeURIComponent(v);
|
||||||
|
tkSrc += v;
|
||||||
|
}
|
||||||
|
tkSrc += sj;
|
||||||
|
tkSrc += 'XSpeUFjJ';
|
||||||
|
console.log(tkSrc);
|
||||||
|
let tk = Crypto.MD5(tkSrc).toString().toLowerCase();
|
||||||
|
console.log(tk);
|
||||||
|
let header = {
|
||||||
|
'user-agent': agentSp || 'okhttp/3.12.0',
|
||||||
|
t: sj,
|
||||||
|
TK: tk,
|
||||||
|
};
|
||||||
|
let res = await req(uri.toString(), {
|
||||||
|
headers: header,
|
||||||
|
});
|
||||||
|
|
||||||
|
let serverTime = res.headers.date; // dart all response header key is lowercase
|
||||||
|
let content = res.content;
|
||||||
|
let serverTimeS = dayjs(serverTime).unix();
|
||||||
|
timeOffset = dayjs().unix() - serverTimeS;
|
||||||
|
// console.log(content);
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
var deviceKey = 'device';
|
||||||
|
var deviceInfo = await local.get(key, deviceKey);
|
||||||
|
if (deviceInfo.length > 0) {
|
||||||
|
try {
|
||||||
|
device = JSON.parse(deviceInfo);
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
if (_.isEmpty(device)) {
|
||||||
|
device = randDevice();
|
||||||
|
device.id = randStr(32).toLowerCase();
|
||||||
|
device.ua = 'Dalvik/2.1.0 (Linux; U; Android ' + device.release + '; ' + device.model + ' Build/' + device.buildId + ')';
|
||||||
|
await local.set(key, deviceKey, JSON.stringify(device));
|
||||||
|
}
|
||||||
|
|
||||||
|
await request(url + '/api.php/provide/getDomain');
|
||||||
|
await request(url + '/api.php/provide/config');
|
||||||
|
await request(url + '/api.php/provide/checkUpgrade');
|
||||||
|
await request(url + '/api.php/provide/channel');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
let data = JSON.parse(await request(url + '/api.php/provide/filter')).data;
|
||||||
|
let classes = [];
|
||||||
|
let filterObj = {};
|
||||||
|
let filterAll = [];
|
||||||
|
for (const key in data) {
|
||||||
|
classes.push({
|
||||||
|
type_id: key,
|
||||||
|
type_name: data[key][0].cat,
|
||||||
|
});
|
||||||
|
if (!filter) continue;
|
||||||
|
try {
|
||||||
|
let typeId = key.toString();
|
||||||
|
if (_.isEmpty(filterAll)) {
|
||||||
|
let filterData = JSON.parse(await request(url + '/api.php/provide/searchFilter?type_id=0&pagenum=1&pagesize=1')).data.conditions;
|
||||||
|
// console.log(filterData);
|
||||||
|
// 年份
|
||||||
|
let year = {
|
||||||
|
key: 'year',
|
||||||
|
name: '年份',
|
||||||
|
init: '',
|
||||||
|
};
|
||||||
|
let yearValues = [];
|
||||||
|
yearValues.push({ n: '全部', v: '' });
|
||||||
|
filterData.y.forEach((e) => {
|
||||||
|
yearValues.push({ n: e.name, v: e.value });
|
||||||
|
});
|
||||||
|
year['value'] = yearValues;
|
||||||
|
// 地区
|
||||||
|
let area = {
|
||||||
|
key: 'area',
|
||||||
|
name: '地区',
|
||||||
|
init: '',
|
||||||
|
};
|
||||||
|
let areaValues = [];
|
||||||
|
areaValues.push({ n: '全部', v: '' });
|
||||||
|
filterData.a.forEach((e) => {
|
||||||
|
areaValues.push({ n: e.name, v: e.value });
|
||||||
|
});
|
||||||
|
area['value'] = areaValues;
|
||||||
|
// 类型
|
||||||
|
let type = {
|
||||||
|
key: 'category',
|
||||||
|
name: '类型',
|
||||||
|
init: '',
|
||||||
|
};
|
||||||
|
let typeValues = [];
|
||||||
|
typeValues.push({ n: '全部', v: '' });
|
||||||
|
filterData.scat.forEach((e) => {
|
||||||
|
typeValues.push({ n: e.name, v: e.value });
|
||||||
|
});
|
||||||
|
type['value'] = typeValues;
|
||||||
|
|
||||||
|
filterAll.push(year, area, type);
|
||||||
|
}
|
||||||
|
if (!_.isEmpty(filterAll)) {
|
||||||
|
filterObj[typeId] = filterAll;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log(classes);
|
||||||
|
// console.log(filterObj);
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
filters: filterObj,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
let data = JSON.parse(await request(url + '/api.php/provide/homeBlock?type_id=0')).data;
|
||||||
|
let blocks = data.blocks;
|
||||||
|
let videos = [];
|
||||||
|
for (const block of blocks) {
|
||||||
|
let name = block.block_name;
|
||||||
|
if (name.indexOf('热播') >= 0) continue;
|
||||||
|
let contents = block.contents;
|
||||||
|
for (const content of contents) {
|
||||||
|
videos.push({
|
||||||
|
vod_id: content.id,
|
||||||
|
vod_name: content.title,
|
||||||
|
vod_pic: content.videoCover,
|
||||||
|
vod_remarks: content.msg,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
let reqUrl = url + '/api.php/provide/searchFilter?type_id=' + tid + '&pagenum=' + pg + '&pagesize=24&';
|
||||||
|
reqUrl += jinja2('year={{ext.year}}&category={{ext.category}}&area={{ext.area}}', { ext: extend });
|
||||||
|
let data = JSON.parse(await request(reqUrl)).data;
|
||||||
|
let videos = [];
|
||||||
|
for (const vod of data.result) {
|
||||||
|
videos.push({
|
||||||
|
vod_id: vod.id,
|
||||||
|
vod_name: vod.title,
|
||||||
|
vod_pic: vod.videoCover,
|
||||||
|
vod_remarks: vod.msg,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: parseInt(data.page),
|
||||||
|
pagecount: data.pagesize,
|
||||||
|
limit: 24,
|
||||||
|
total: data.total,
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
let data = JSON.parse(await request(url + '/api.php/provide/videoDetail?ids=' + id)).data;
|
||||||
|
console.log(data);
|
||||||
|
let vod = {
|
||||||
|
vod_id: data.id,
|
||||||
|
vod_name: data.videoName,
|
||||||
|
vod_pic: data.videoCover,
|
||||||
|
type_name: data.subCategory,
|
||||||
|
vod_year: data.year,
|
||||||
|
vod_area: data.area,
|
||||||
|
vod_remarks: data.msg,
|
||||||
|
vod_actor: data.actor,
|
||||||
|
vod_director: data.director,
|
||||||
|
vod_content: data.brief.trim(),
|
||||||
|
};
|
||||||
|
let episodes = JSON.parse(await request(url + '/api.php/provide/videoPlaylist?ids=' + id)).data.episodes;
|
||||||
|
let playlist = {};
|
||||||
|
for (const episode of episodes) {
|
||||||
|
let playurls = episode.playurls;
|
||||||
|
for (const playurl of playurls) {
|
||||||
|
let from = playurl.playfrom;
|
||||||
|
let t = formatPlayUrl(vod.vod_name, playurl.title);
|
||||||
|
if (t.length == 0) t = playurl.title.trim();
|
||||||
|
if (!playlist.hasOwnProperty(from)) {
|
||||||
|
playlist[from] = [];
|
||||||
|
}
|
||||||
|
playlist[from].push(t + '$' + playurl.playurl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vod.vod_play_from = _.keys(playlist).join('$$$');
|
||||||
|
let urls = _.values(playlist);
|
||||||
|
let vod_play_url = [];
|
||||||
|
for (const urlist of urls) {
|
||||||
|
vod_play_url.push(urlist.join('#'));
|
||||||
|
}
|
||||||
|
vod.vod_play_url = vod_play_url.join('$$$');
|
||||||
|
return JSON.stringify({
|
||||||
|
list: [vod],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
try {
|
||||||
|
let data = JSON.parse(await request(url + '/api.php/provide/parserUrl?url=' + id + '&retryNum=0')).data;
|
||||||
|
let playHeader = data.playHeader;
|
||||||
|
let jxUrl = data.url;
|
||||||
|
let res = await req(jxUrl, {
|
||||||
|
headers: {
|
||||||
|
'user-agent': 'okhttp/3.12.0',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
let result = jsonParse(id, JSON.parse(res.content));
|
||||||
|
result['parse'] = 0;
|
||||||
|
if (playHeader) {
|
||||||
|
result.header = _.merge(result.header, playHeader);
|
||||||
|
}
|
||||||
|
return JSON.stringify(result);
|
||||||
|
} catch (e) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let page = pg || 1;
|
||||||
|
if (page == 0) page = 1;
|
||||||
|
let data = JSON.parse(await request(url + '/api.php/provide/searchVideo?searchName=' + wd + '&pg=' + page, 'okhttp/3.12.0'));
|
||||||
|
let videos = [];
|
||||||
|
for (const vod of data.data) {
|
||||||
|
videos.push({
|
||||||
|
vod_id: vod.id,
|
||||||
|
vod_name: vod.videoName,
|
||||||
|
vod_pic: vod.videoCover,
|
||||||
|
vod_remarks: vod.msg,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
page: page,
|
||||||
|
pagecount: data.pages,
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
|
function randStr(len, withNum) {
|
||||||
|
var _str = '';
|
||||||
|
let containsNum = withNum === undefined ? true : withNum;
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
let idx = _.random(0, containsNum ? charStr.length - 1 : charStr.length - 11);
|
||||||
|
_str += charStr[idx];
|
||||||
|
}
|
||||||
|
return _str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function randDevice() {
|
||||||
|
return {
|
||||||
|
brand: 'Huawei',
|
||||||
|
model: 'HUAWEI Mate 20',
|
||||||
|
release: '10',
|
||||||
|
buildId: randStr(3, false).toUpperCase() + _.random(11, 99) + randStr(1, false).toUpperCase(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPlayUrl(src, name) {
|
||||||
|
return name
|
||||||
|
.trim()
|
||||||
|
.replaceAll(src, '')
|
||||||
|
.replace(/<|>|《|》/g, '')
|
||||||
|
.replace(/\$|#/g, ' ')
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonParse(input, json) {
|
||||||
|
try {
|
||||||
|
let url = json.url ?? '';
|
||||||
|
if (url.startsWith('//')) {
|
||||||
|
url = 'https:' + url;
|
||||||
|
}
|
||||||
|
if (!url.startsWith('http')) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
let headers = json['headers'] || {};
|
||||||
|
let ua = (json['user-agent'] || '').trim();
|
||||||
|
if (ua.length > 0) {
|
||||||
|
headers['User-Agent'] = ua;
|
||||||
|
}
|
||||||
|
let referer = (json['referer'] || '').trim();
|
||||||
|
if (referer.length > 0) {
|
||||||
|
headers['Referer'] = referer;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
header: headers,
|
||||||
|
url: url,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,195 @@
|
|||||||
|
import { Crypto, load, _ } from 'assets://js/lib/cat.js';
|
||||||
|
|
||||||
|
let key = 'xinshijue';
|
||||||
|
let HOST = 'https://www.hdmyy.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';
|
||||||
|
|
||||||
|
async function request(reqUrl, timeout = 20000) {
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: 'get',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': UA,
|
||||||
|
'Referer': HOST
|
||||||
|
},
|
||||||
|
timeout: timeout,
|
||||||
|
});
|
||||||
|
return res.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cfg = {skey: siteKey, ext: extend}
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
let classes = [{'type_id':1,'type_name':'电影'},{'type_id':2,'type_name':'电视剧'},{'type_id':3,'type_name':'综艺'},{'type_id':4,'type_name':'动漫'},{'type_id':63,'type_name':'纪录片'}];
|
||||||
|
let filterObj = {
|
||||||
|
'1':[{'key':'class','name':'剧情','init':'','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':'古装','v':'古装'},{'n':'历史','v':'历史'},{'n':'运动','v':'运动'},{'n':'农村','v':'农村'},{'n':'儿童','v':'儿童'},{'n':'网络电影','v':'网络电影'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'中国大陆','v':'中国大陆'},{'n':'中国香港','v':'中国香港'},{'n':'中国台湾','v':'中国台湾'},{'n':'美国','v':'美国'},{'n':'法国','v':'法国'},{'n':'英国','v':'英国'},{'n':'日本','v':'日本'},{'n':'韩国','v':'韩国'},{'n':'德国','v':'德国'},{'n':'泰国','v':'泰国'},{'n':'印度','v':'印度'},{'n':'意大利','v':'意大利'},{'n':'西班牙','v':'西班牙'},{'n':'加拿大','v':'加拿大'},{'n':'其他','v':'其他'}]},{'key':'year','name':'年份','init':'','value':[{'n':'全部','v':''},{'n':'2023','v':'2023'},{'n':'2022','v':'2022'},{'n':'2021','v':'2021'},{'n':'2020','v':'2020'},{'n':'2019','v':'2019'},{'n':'2018','v':'2018'},{'n':'2017','v':'2017'},{'n':'2016','v':'2016'},{'n':'2015','v':'2015'},{'n':'2014','v':'2014'},{'n':'2013','v':'2013'},{'n':'2012','v':'2012'},{'n':'2011','v':'2011'},{'n':'2010','v':'2010'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
|
||||||
|
'2':[{'key':'class','name':'剧情','init':'','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':'短剧','v':'短剧'},{'n':'其他','v':'其他'}]},{'key':'area','name':'地区','init':'','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':'year','name':'年份','init':'','value':[{'n':'全部','v':''},{'n':'2023','v':'2023'},{'n':'2022','v':'2022'},{'n':'2021','v':'2021'},{'n':'2020','v':'2020'},{'n':'2019','v':'2019'},{'n':'2018','v':'2018'},{'n':'2017','v':'2017'},{'n':'2016','v':'2016'},{'n':'2015','v':'2015'},{'n':'2014','v':'2014'},{'n':'2013','v':'2013'},{'n':'2012','v':'2012'},{'n':'2011','v':'2011'},{'n':'2010','v':'2010'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
|
||||||
|
'3':[{'key':'class','name':'剧情','init':'','value':[{'n':'全部','v':''},{'n':'音乐','v':'音乐'},{'n':'情感','v':'情感'},{'n':'生活','v':'生活'},{'n':'职场','v':'职场'},{'n':'真人秀','v':'真人秀'},{'n':'搞笑','v':'搞笑'},{'n':'公益','v':'公益'},{'n':'艺术','v':'艺术'},{'n':'访谈','v':'访谈'},{'n':'益智','v':'益智'},{'n':'体育','v':'体育'},{'n':'少儿','v':'少儿'},{'n':'时尚','v':'时尚'},{'n':'人物','v':'人物'},{'n':'其他','v':'其他'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'中国大陆','v':'中国大陆'},{'n':'港台','v':'港台'},{'n':'韩国','v':'韩国'},{'n':'欧美','v':'欧美'},{'n':'其他','v':'其他'}]},{'key':'year','name':'年份','init':'','value':[{'n':'全部','v':''},{'n':'2023','v':'2023'},{'n':'2022','v':'2022'},{'n':'2021','v':'2021'},{'n':'2020','v':'2020'},{'n':'2019','v':'2019'},{'n':'2018','v':'2018'},{'n':'2017','v':'2017'},{'n':'2016','v':'2016'},{'n':'2015','v':'2015'},{'n':'2014','v':'2014'},{'n':'2013','v':'2013'},{'n':'2012','v':'2012'},{'n':'2011','v':'2011'},{'n':'2010','v':'2010'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
|
||||||
|
'4':[{'key':'class','name':'剧情','init':'','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':'其他'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'中国大陆','v':'中国大陆'},{'n':'日本','v':'日本'},{'n':'韩国','v':'韩国'},{'n':'欧美','v':'欧美'},{'n':'其他','v':'其他'}]},{'key':'year','name':'年份','init':'','value':[{'n':'全部','v':''},{'n':'2023','v':'2023'},{'n':'2022','v':'2022'},{'n':'2021','v':'2021'},{'n':'2020','v':'2020'},{'n':'2019','v':'2019'},{'n':'2018','v':'2018'},{'n':'2017','v':'2017'},{'n':'2016','v':'2016'},{'n':'2015','v':'2015'},{'n':'2014','v':'2014'},{'n':'2013','v':'2013'},{'n':'2012','v':'2012'},{'n':'2011','v':'2011'},{'n':'2010','v':'2010'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
|
||||||
|
'63':[{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
|
||||||
|
};
|
||||||
|
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
filters: filterObj,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
if (pg <= 0) pg = 1;
|
||||||
|
let page = '';
|
||||||
|
if (pg > 1) {
|
||||||
|
page = pg;
|
||||||
|
}
|
||||||
|
const link = HOST + '/vodshow/' + tid + '-' + (extend.area || '') + '-' + (extend.by || '') + '-' + (extend.class || '') + '-' + (extend.lang || '') + '-' + (extend.letter || '') + '---' + page + '---' + (extend.year || '') + '.html';
|
||||||
|
const html = await request(link);
|
||||||
|
const $ = load(html);
|
||||||
|
const items = $('.module-list .module-item');
|
||||||
|
const videos = _.map(items, (item) => {
|
||||||
|
const $item = $(item);
|
||||||
|
const link = $item.find('.module-item-content a:first').attr('href');
|
||||||
|
const title = $item.find('.video-name').text().trim();
|
||||||
|
const img = $item.find('.module-item-pic img:first').attr('data-src');
|
||||||
|
const remarks = $item.find('.module-item-text').text().trim();
|
||||||
|
return {
|
||||||
|
vod_id: link.replace(/.*?\/video\/(.*).html/g, '$1'),
|
||||||
|
vod_name: title,
|
||||||
|
vod_pic: img,
|
||||||
|
vod_remarks: remarks || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const hasMore = $('#page a.page-next:contains(下一页)').length > 0;
|
||||||
|
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||||
|
const limit = 40;
|
||||||
|
return JSON.stringify({
|
||||||
|
page: parseInt(pg),
|
||||||
|
pagecount: pgCount,
|
||||||
|
limit: limit,
|
||||||
|
total: limit * pgCount,
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
const html = await request(HOST + '/video/' + id + '.html');
|
||||||
|
const $ = load(html);
|
||||||
|
const vod = {
|
||||||
|
vod_id: id,
|
||||||
|
vod_name: $('h1.page-title').text().trim(),
|
||||||
|
vod_type: $('.video-info-aux a.tag-link:first').text().trim(),
|
||||||
|
vod_area: $('.video-info-aux a.tag-link:eq(2)').text().trim(),
|
||||||
|
vod_year: $('.video-info-aux a.tag-link:eq(1)').text().trim(),
|
||||||
|
vod_director: $('.video-info-main .video-info-items:contains(导演:)').text().substring(3).trim().replace(/(^\/|\/$)/g, '').trim(),
|
||||||
|
vod_actor: $('.video-info-main .video-info-items:contains(主演:)').text().substring(3).trim().replace(/(^\/|\/$)/g, '').trim(),
|
||||||
|
vod_pic: $('.video-cover img:first').attr('data-src'),
|
||||||
|
vod_remarks : $('.video-info-main .video-info-items:contains(备注:)').text().substring(3) || '',
|
||||||
|
vod_content: $('.video-info-main .video-info-items:contains(剧情:)').text().substring(3).trim().replace(/收起$/g, ''),
|
||||||
|
};
|
||||||
|
const playMap = {};
|
||||||
|
const tabs = $('.module-player-tab .module-tab-item');
|
||||||
|
const playlists = $('.module-player-list > .module-blocklist');
|
||||||
|
_.each(tabs, (tab, i) => {
|
||||||
|
const $tab = $(tab);
|
||||||
|
const from = $tab.find('span:first').text().trim();
|
||||||
|
if (from.includes('夸克')) return;
|
||||||
|
let list = playlists[i];
|
||||||
|
list = $(list).find('a');
|
||||||
|
_.each(list, (it) => {
|
||||||
|
const $it = $(it);
|
||||||
|
const title = $it.find('span:first').text().trim();
|
||||||
|
const playUrl = $it.attr('href');
|
||||||
|
if (!playMap.hasOwnProperty(from)) {
|
||||||
|
playMap[from] = [];
|
||||||
|
}
|
||||||
|
playMap[from].push(title + '$' + playUrl);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
vod.vod_play_from = _.keys(playMap).join('$$$');
|
||||||
|
const urls = _.values(playMap);
|
||||||
|
const 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 link = HOST + id;
|
||||||
|
const html = await request(link);
|
||||||
|
let $ = load(html);
|
||||||
|
let json = $('script:contains(player_aaaa)').text().replace('var player_aaaa=','');
|
||||||
|
let js = JSON.parse(json);
|
||||||
|
let playUrl = js.url;
|
||||||
|
if (js.encrypt == 1) {
|
||||||
|
playUrl = unescape(playUrl);
|
||||||
|
} else if (js.encrypt == 2) {
|
||||||
|
playUrl = unescape(base64Decode(playUrl));
|
||||||
|
}
|
||||||
|
let playHtml = await request('https://jx3.xn--1lq90i13mxk5bolhm8k.xn--fiqs8s/player/ec.php?code=ak&if=1&url=' + playUrl);
|
||||||
|
json = playHtml.match(/let ConFig = {([\w\W]*)},box/)[1];
|
||||||
|
const jsConfig = JSON.parse('{' + json.trim() + '}');
|
||||||
|
playUrl = decryptUrl(jsConfig);
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: playUrl,
|
||||||
|
header: {
|
||||||
|
'User-Agent': UA,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function decryptUrl(jsConfig) {
|
||||||
|
const key = Crypto.enc.Utf8.parse('2890' + jsConfig.config.uid + 'tB959C');
|
||||||
|
const iv = Crypto.enc.Utf8.parse('2F131BE91247866E');
|
||||||
|
const mode = Crypto.mode.CBC;
|
||||||
|
const padding = Crypto.pad.Pkcs7;
|
||||||
|
const decrypted = Crypto.AES.decrypt(jsConfig.url, key, {
|
||||||
|
'iv': iv,
|
||||||
|
'mode': mode,
|
||||||
|
'padding': padding
|
||||||
|
});
|
||||||
|
const decryptedUrl = Crypto.enc.Utf8.stringify(decrypted);
|
||||||
|
return decryptedUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64Decode(text) {
|
||||||
|
return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let data = JSON.parse(await request(HOST + '/index.php/ajax/suggest?mid=1&limit=50&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,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,272 @@
|
|||||||
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let siteUrl = 'https://www.cs1369.com';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
let headers = {};
|
||||||
|
|
||||||
|
async function request(reqUrl, postData, agentSp, get) {
|
||||||
|
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: get ? 'get' : 'post',
|
||||||
|
headers: headers,
|
||||||
|
data: postData || {},
|
||||||
|
postType: get ? '' : 'form',
|
||||||
|
});
|
||||||
|
|
||||||
|
let content = res.content;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
let classes = [{
|
||||||
|
type_id: '1',
|
||||||
|
type_name: '电影',
|
||||||
|
},{
|
||||||
|
type_id: '2',
|
||||||
|
type_name: '电视',
|
||||||
|
},{
|
||||||
|
type_id: '3',
|
||||||
|
type_name: '动漫',
|
||||||
|
}];
|
||||||
|
|
||||||
|
let filterObj = genFilterObj();
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
filters: filterObj
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
let videos = await getVideos(siteUrl);
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
let url = siteUrl;
|
||||||
|
if (filter) {
|
||||||
|
url = url + '/show';
|
||||||
|
let area = extend['area'];
|
||||||
|
if (area && area != '') {
|
||||||
|
url = url + '/area/' + area;
|
||||||
|
}
|
||||||
|
let clazz = extend['class']
|
||||||
|
if (clazz && clazz != '') {
|
||||||
|
url = url + '/class/' + clazz;
|
||||||
|
}
|
||||||
|
let id = extend['id'];
|
||||||
|
if(id && id != '') {
|
||||||
|
url = url + '/id/' + id;
|
||||||
|
} else {
|
||||||
|
url = url + '/id/' + tid;
|
||||||
|
}
|
||||||
|
let year = extend['year'];
|
||||||
|
if (year && year != '') {
|
||||||
|
url = url + '/year/' + year;
|
||||||
|
}
|
||||||
|
if (pg && pg > 1) {
|
||||||
|
url = url + '/page/' + pg;
|
||||||
|
}
|
||||||
|
url = url + '.html';
|
||||||
|
} else {
|
||||||
|
url = url + '/vod/type';
|
||||||
|
url = url + '/id/' + tid;
|
||||||
|
if (pg && pg > 1) {
|
||||||
|
url = url + '/page/' + pg;
|
||||||
|
}
|
||||||
|
url = url + '.html';
|
||||||
|
}
|
||||||
|
//console.log('cate page url:', url);
|
||||||
|
|
||||||
|
let videos = await getVideos(url);
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
page: pg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
try {
|
||||||
|
let url = siteUrl + id;
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
let actors = _.map($('div.stui-content__detail > p:nth-child(3) > a'), (n) => {
|
||||||
|
return $(n).text();
|
||||||
|
});
|
||||||
|
let actor = actors.join(' ');
|
||||||
|
let director = $('div.stui-content__detail > p:nth-child(4) > a').text();
|
||||||
|
let title = $('div.stui-content__detail > h1.title').text();
|
||||||
|
let content = $('div.stui-pannel_bd > p').text();
|
||||||
|
const cards = $('div.stui-pannel_bd.col-pd.clearfix > ul > li > a');
|
||||||
|
let playUrls = _.map(cards, (n) => {
|
||||||
|
return $(n).text() + '$' + n.attribs['href'];
|
||||||
|
});
|
||||||
|
|
||||||
|
const video = {
|
||||||
|
vod_actor: actor,
|
||||||
|
vod_play_from: 'Leospring',
|
||||||
|
vod_play_url: playUrls.join('#'),
|
||||||
|
vod_director: director,
|
||||||
|
vod_content: content,
|
||||||
|
};
|
||||||
|
const list = [video];
|
||||||
|
const result = { list };
|
||||||
|
return JSON.stringify(result);
|
||||||
|
} catch (e) {
|
||||||
|
//console.log('err', e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let url = siteUrl + '/search/wd/' + wd + '.html';
|
||||||
|
//console.log('search url:', url);
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.stui-pannel_bd > ul.stui-vodlist__media.col-pd.clearfix > li');
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = $($(n).find('div.thumb > a')[0]).attr('href');
|
||||||
|
let name = $($(n).find('div.thumb > a')[0]).attr('title');
|
||||||
|
let pic = $($(n).find('div.thumb > a')[0]).attr('data-original');
|
||||||
|
let remark = $($(n).find('div.thumb > a > span:nth-child(2)')[0]).text();
|
||||||
|
|
||||||
|
return {
|
||||||
|
vod_id: id,
|
||||||
|
vod_name: name,
|
||||||
|
vod_pic: pic,
|
||||||
|
vod_remarks: remark,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
let url = siteUrl + id;
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
let info = '';
|
||||||
|
for(const n of $('script')) {
|
||||||
|
if($(n).text().indexOf('player_aaaa=') > 0) {
|
||||||
|
info = $(n).text().split('player_aaaa=')[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log('info', info);
|
||||||
|
let obj = JSON.parse(info);
|
||||||
|
let playUrl = obj.url;
|
||||||
|
if(obj.encrypt == 1) {
|
||||||
|
playUrl = unescape(playUrl);
|
||||||
|
} else if (obj.encrypt == 2) {
|
||||||
|
playUrl = unescape(base64Decode(playUrl))
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: playUrl,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function genFilterObj() {
|
||||||
|
return {
|
||||||
|
'1':[
|
||||||
|
{
|
||||||
|
key: 'id',
|
||||||
|
name: '类型',
|
||||||
|
value: [{n:'全部',v:''},{n:'动作片',v:'6'},{n:'喜剧片',v:'7'},{n:'爱情片',v:'8'},{n:'科幻片',v:'9'},{n:'恐怖片',v:'10'},{n:'剧情片',v:'11'},{n:'战争片',v:'12'},{n:'动画片',v:'13'},{n:'纪录片',v:'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:'历史',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:'英国'},{n:'法国',v:'法国'},{n:'加拿大',v:'加拿大'},{n:'西班牙',v:'西班牙'},{n:'俄罗斯',v:'俄罗斯'}]
|
||||||
|
},{
|
||||||
|
key: 'year',
|
||||||
|
name: '年份',
|
||||||
|
value: [{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'},{n:'2009',v:'2009'},{n:'2008',v:'2008'},{n:'2007',v:'2007'},{n:'2006',v:'2006'},{n:'2005',v:'2005'},{n:'2004',v:'2004'},{n:'2003',v:'2003'},{n:'2002',v:'2002'},{n:'2001',v:'2001'},{n:'2000',v:'2000'}]
|
||||||
|
}],
|
||||||
|
'2':[{
|
||||||
|
key: 'id',
|
||||||
|
name: '类型',
|
||||||
|
value: [{n:'全部',v:''},{n:'内地',v:'15'},{n:'美国',v:'16'},{n:'英国',v:'17'},{n:'韩国',v:'18'},{n:'泰国',v:'20'},{n:'日本',v:'21'},{n:'香港',v:'22'},{n:'台湾',v:'23'}]
|
||||||
|
},{
|
||||||
|
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:'网剧'}]
|
||||||
|
},{
|
||||||
|
key: 'area',
|
||||||
|
name: '地区',
|
||||||
|
value: [{n:'全部',v:''},{n:'中国大陆',v:'中国大陆'},{n:'中国香港',v:'中国香港'},{n:'中国台湾',v:'中国台湾'},{n:'美国',v:'美国'},{n:'韩国',v:'韩国'},{n:'日本',v:'日本'},{n:'泰国',v:'泰国'},{n:'新加坡',v:'新加坡'},{n:'马来西亚',v:'马来西亚'},{n:'印度',v:'印度'},{n:'英国',v:'英国'},{n:'法国',v:'法国'},{n:'加拿大',v:'加拿大'},{n:'西班牙',v:'西班牙'},{n:'俄罗斯',v:'俄罗斯'}]
|
||||||
|
},{
|
||||||
|
key: 'year',
|
||||||
|
name: '年份',
|
||||||
|
value: [{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'},{n:'2009',v:'2009'},{n:'2008',v:'2008'},{n:'2007',v:'2007'},{n:'2006',v:'2006'},{n:'2005',v:'2005'},{n:'2004',v:'2004'},{n:'2003',v:'2003'},{n:'2002',v:'2002'},{n:'2001',v:'2001'},{n:'2000',v:'2000'}]
|
||||||
|
}],
|
||||||
|
'3':[{
|
||||||
|
key: 'id',
|
||||||
|
name: '类型',
|
||||||
|
value: [{n:'全部',v:''},{n:'内地',v:'25'},{n:'日漫',v:'26'},{n:'欧美',v:'27'},{n:'其他',v:'28'}]
|
||||||
|
},{
|
||||||
|
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:'励志'}]
|
||||||
|
},{
|
||||||
|
key: 'area',
|
||||||
|
name: '地区',
|
||||||
|
value: [{n:'全部',v:''},{n:'中国大陆',v:'中国大陆'},{n:'中国香港',v:'中国香港'},{n:'中国台湾',v:'中国台湾'},{n:'美国',v:'美国'},{n:'韩国',v:'韩国'},{n:'日本',v:'日本'},{n:'泰国',v:'泰国'},{n:'新加坡',v:'新加坡'},{n:'马来西亚',v:'马来西亚'},{n:'印度',v:'印度'},{n:'英国',v:'英国'},{n:'法国',v:'法国'},{n:'加拿大',v:'加拿大'},{n:'西班牙',v:'西班牙'},{n:'俄罗斯',v:'俄罗斯'}]
|
||||||
|
},{
|
||||||
|
key: 'year',
|
||||||
|
name: '年份',
|
||||||
|
value: [{n:'全部',v:''},{n:'2023',v:'2023'},{n:'2022',v:'2022'},{n:'2021',v:'2021'},{n:'2020',v:'2020'},{n:'2019',v:'2019'},{n:'2018',v:'2018'},{n:'2017',v:'2017'},{n:'2016',v:'2016'},{n:'2015',v:'2015'},{n:'2014',v:'2014'},{n:'2013',v:'2013'},{n:'2012',v:'2012'},{n:'2011',v:'2011'},{n:'2010',v:'2010'},{n:'2009',v:'2009'},{n:'2008',v:'2008'},{n:'2007',v:'2007'},{n:'2006',v:'2006'},{n:'2005',v:'2005'},{n:'2004',v:'2004'},{n:'2003',v:'2003'},{n:'2002',v:'2002'},{n:'2001',v:'2001'},{n:'2000',v:'2000'}]
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getVideos(url) {
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.stui-vodlist__box > a')
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['href'];
|
||||||
|
let name = n.attribs['title'];
|
||||||
|
let pic = n.attribs['data-original'];
|
||||||
|
let remark = $($(n).find('span:nth-child(2)')[0]).text();
|
||||||
|
return {
|
||||||
|
vod_id: id,
|
||||||
|
vod_name: name,
|
||||||
|
vod_pic: pic,
|
||||||
|
vod_remarks: remark,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return videos;
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64Encode(text) {
|
||||||
|
return Crypto.enc.Base64.stringify(Crypto.enc.Utf8.parse(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64Decode(text) {
|
||||||
|
return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function __jsEvalReturn() {
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
home: home,
|
||||||
|
homeVod: homeVod,
|
||||||
|
category: category,
|
||||||
|
detail: detail,
|
||||||
|
play: play,
|
||||||
|
search: search,
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,162 @@
|
|||||||
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
|
let siteUrl = 'https://gh.7761.cf/https://zz123.com';
|
||||||
|
let imgUrl = 'https://music.jsbaidu.com';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
let headers = {};
|
||||||
|
|
||||||
|
async function request(reqUrl, postData, agentSp, get) {
|
||||||
|
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: get ? 'get' : 'post',
|
||||||
|
headers: headers,
|
||||||
|
data: postData || {},
|
||||||
|
postType: get ? '' : 'form',
|
||||||
|
});
|
||||||
|
|
||||||
|
let content = res.content;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
if (cfg.ext) {
|
||||||
|
siteUrl = cfg.ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
const html = await request(siteUrl);
|
||||||
|
const $ = load(html);
|
||||||
|
const cates = $('ul.aside-menu-list.channel > li')
|
||||||
|
let classes = _.map(cates, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('a > span')[0]).text();
|
||||||
|
return {
|
||||||
|
type_id: id,
|
||||||
|
type_name: name,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
const html = await request(siteUrl);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.page-main-wrap > div > div > div.card-list.d-none.d-md-block > div')
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('div.item-info > div > div.songname.text-ellipsis.color-link-content-primary > a')[0]).text();
|
||||||
|
let pic = $($(n).find('div.item-cover-wrap > a > img')[0]).attr('data-src').replace('/img', imgUrl);
|
||||||
|
let remark = $($(n).find('div.item-cover-wrap > div.item-time')[0]).text();
|
||||||
|
return {
|
||||||
|
book_id: id,
|
||||||
|
book_name: name,
|
||||||
|
book_pic: pic,
|
||||||
|
book_remarks: remark,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
if (pg <= 0) pg = 1;
|
||||||
|
let url = siteUrl + '/ajax/';
|
||||||
|
let res = await req(url, {
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
act: 'tag_music',
|
||||||
|
type: 'tuijian',
|
||||||
|
tid: tid,
|
||||||
|
page: pg,
|
||||||
|
lang: '',
|
||||||
|
},
|
||||||
|
postType: 'form',
|
||||||
|
});
|
||||||
|
//console.log('catedata:', res);
|
||||||
|
let data = JSON.parse(res.content).data;
|
||||||
|
let videos = [];
|
||||||
|
for(let i=0;i<data.length;i++){
|
||||||
|
const item = data[i];
|
||||||
|
videos.push({
|
||||||
|
book_id: item['mp3'],
|
||||||
|
book_name: item['mname'],
|
||||||
|
book_pic: item['pic'].replace('/img', imgUrl),
|
||||||
|
book_remarks: item['play_time'],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
try {
|
||||||
|
let playUrl = id;
|
||||||
|
if(!id.startsWith('http')) {
|
||||||
|
playUrl = siteUrl + '/xplay/?act=songplay&id=' + id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const video = {
|
||||||
|
book_id: id,
|
||||||
|
book_actor: 'Leospring',
|
||||||
|
book_play_from: 'Leospring',
|
||||||
|
urls: '播放$' + playUrl,
|
||||||
|
book_director: 'Leospring',
|
||||||
|
book_content: '该音乐由公众号【蚂蚁科技杂谈】用爱发电制作,欢迎收听!',
|
||||||
|
};
|
||||||
|
const list = [video];
|
||||||
|
const result = { list };
|
||||||
|
return JSON.stringify(result);
|
||||||
|
} catch (e) {}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let url = siteUrl + '/search/?key=' + wd;
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.tab-item.tab-song > div.card-list.d-none.d-md-block > div')
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('div.item-info > div > div.songname.text-ellipsis.color-link-content-primary > a')[0]).text();
|
||||||
|
let pic = $($(n).find('div.item-cover-wrap > a > img')[0]).attr('data-src').replace('/img', imgUrl);
|
||||||
|
let remark = $($(n).find('div.item-cover-wrap > div.item-time')[0]).text();
|
||||||
|
|
||||||
|
return {
|
||||||
|
book_id: id,
|
||||||
|
book_name: name,
|
||||||
|
book_pic: pic,
|
||||||
|
book_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,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
//代理地址
|
||||||
|
let siteUrl = 'https://gh.7761.cf/https://zz123.com';
|
||||||
|
let imgUrl = 'https://music.jsbaidu.com';
|
||||||
|
let siteKey = '';
|
||||||
|
let siteType = 0;
|
||||||
|
let headers = {};
|
||||||
|
|
||||||
|
async function request(reqUrl, postData, agentSp, get) {
|
||||||
|
|
||||||
|
let res = await req(reqUrl, {
|
||||||
|
method: get ? 'get' : 'post',
|
||||||
|
headers: headers,
|
||||||
|
data: postData || {},
|
||||||
|
postType: get ? '' : 'form',
|
||||||
|
});
|
||||||
|
|
||||||
|
let content = res.content;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init(cfg) {
|
||||||
|
siteKey = cfg.skey;
|
||||||
|
siteType = cfg.stype;
|
||||||
|
if (cfg.ext) {
|
||||||
|
siteUrl = cfg.ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function home(filter) {
|
||||||
|
const html = await request(siteUrl);
|
||||||
|
const $ = load(html);
|
||||||
|
const cates = $('ul.aside-menu-list.channel > li')
|
||||||
|
let classes = _.map(cates, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('a > span')[0]).text();
|
||||||
|
return {
|
||||||
|
type_id: id,
|
||||||
|
type_name: name
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
class: classes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function homeVod() {
|
||||||
|
const html = await request(siteUrl);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.page-main-wrap > div > div > div.card-list.d-none.d-md-block > div');
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('div.item-info > div > div.songname.text-ellipsis.color-link-content-primary > a')[0]).text();
|
||||||
|
let pic = $($(n).find('div.item-cover-wrap > a > img')[0]).attr('data-src').replace('/img', imgUrl);
|
||||||
|
let remark = $($(n).find('div.item-cover-wrap > div.item-time')[0]).text();
|
||||||
|
return {
|
||||||
|
vod_id: id,
|
||||||
|
vod_name: name,
|
||||||
|
vod_pic: pic,
|
||||||
|
vod_remarks: remark
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function category(tid, pg, filter, extend) {
|
||||||
|
if (pg <= 0) pg = 1;
|
||||||
|
let url = siteUrl + '/ajax/';
|
||||||
|
let res = await req(url, {
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
act: 'tag_music',
|
||||||
|
type: 'tuijian',
|
||||||
|
tid: tid,
|
||||||
|
page: pg,
|
||||||
|
lang: ''
|
||||||
|
},
|
||||||
|
postType: 'form'
|
||||||
|
});
|
||||||
|
//console.log('catedata:', res);
|
||||||
|
let data = JSON.parse(res.content).data;
|
||||||
|
let videos = [];
|
||||||
|
for(let i=0;i<data.length;i++){
|
||||||
|
const item = data[i];
|
||||||
|
videos.push({
|
||||||
|
vod_id: item['mp3'],
|
||||||
|
vod_name: item['mname'],
|
||||||
|
vod_pic: item['pic'].replace('/img', imgUrl),
|
||||||
|
vod_remarks: item['play_time']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
list: videos
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function detail(id) {
|
||||||
|
try {
|
||||||
|
let playUrl = id;
|
||||||
|
if(!id.startsWith('http')) {
|
||||||
|
playUrl = siteUrl + '/xplay/?act=songplay&id=' + id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const video = {
|
||||||
|
vod_id: id,
|
||||||
|
vod_actor: 'Leospring',
|
||||||
|
vod_play_from: 'Leospring',
|
||||||
|
vod_play_url: '播放$' + playUrl,
|
||||||
|
vod_director: 'Leospring',
|
||||||
|
vod_content: '该音乐由公众号【蚂蚁科技杂谈】用爱发电制作,欢迎收听!',
|
||||||
|
};
|
||||||
|
const list = [video];
|
||||||
|
const result = { list };
|
||||||
|
return JSON.stringify(result);
|
||||||
|
} catch (e) {}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function play(flag, id, flags) {
|
||||||
|
return JSON.stringify({
|
||||||
|
parse: 0,
|
||||||
|
url: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function search(wd, quick, pg) {
|
||||||
|
let url = siteUrl + '/search/?key=' + wd;
|
||||||
|
const html = await request(url);
|
||||||
|
const $ = load(html);
|
||||||
|
const cards = $('div.tab-item.tab-song > div.card-list.d-none.d-md-block > div')
|
||||||
|
let videos = _.map(cards, (n) => {
|
||||||
|
let id = n.attribs['data-id'];
|
||||||
|
let name = $($(n).find('div.item-info > div > div.songname.text-ellipsis.color-link-content-primary > a')[0]).text();
|
||||||
|
let pic = $($(n).find('div.item-cover-wrap > a > img')[0]).attr('data-src').replace('/img', imgUrl);
|
||||||
|
let remark = $($(n).find('div.item-cover-wrap > div.item-time')[0]).text();
|
||||||
|
|
||||||
|
return {
|
||||||
|
vod_id: id,
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in new issue