update FTY

This commit is contained in:
qist
2023-12-21 11:45:13 +08:00
parent a70366fafa
commit d3b8c7fe8f
58 changed files with 8327 additions and 319 deletions
+4
View File
@@ -28,6 +28,8 @@
{"key":"pansearch_open","name":"阿里 | 盘搜索","type":3,"api":"assets://js/pansearch_open.js","ext":"填入你的token"},
{"key":"funletu","name":"夸克 | 趣盘搜","type":3,"api":"assets://js/funletu.js","ext":"夸克cookie,可http"},
{"key":"ys996_open","name":"影视 | 996","type":3,"api":"assets://js/ys996_open.js"},
{"key":"star_open","name":"影视 | 星视界","type":3,"api":"assets://js/star_open.js"},
{"key":"ytvip","name":"影视 | 影探","type":3,"api":"assets://js/yt.js","ext":"http://ytcms.lyyytv.cn/api.php/app/"},
{"key":"yqktv_open","name":"影视 | 一起看","type":3,"api":"assets://js/yqktv_open.js"},
{"key":"555dy_open","name":"影视 | 555","type":3,"api":"assets://js/555dy_open.js"},
@@ -135,6 +137,7 @@
{"key":"mybili","name":"B站 | 哔哩综合","type":3,"api":"assets://js/mybili_open.js"},
{"key":"bili_open","name":"B站 | 我的哔哩","type":3,"api":"assets://js/bili_open.js","ext":{"categories":"沙雕动画#健身#音乐#舞蹈#风景#美食#科普#历史#法考#医考","cookie":"填自己的cookie"}},
{"key":"kuqimv","name":"MV | 酷奇","type":3,"api":"assets://js/kuqimv_open.js"},
{"key":"zzmusic_open","name":"音乐 | 渣渣","type":3,"api":"assets://js/zzmusic_open.js"},
{"key":"drpy_js_cntv_open","name":"电视 | 视聚场","type":3,"api":"assets://js/cntv_open.js"},
{"key":"哈喽","name":"V2 | 哈喽","type":3,"api":"assets://js/appysv2.js","ext":"http://www.miniku.cc/xgapp.php/v1/"},
@@ -175,6 +178,7 @@
{"key":"guangsuapi","name":"采集 | 光速","type":3,"api":"assets://js/caiji.js","ext":"http://api.guangsuapi.com/api.php/provide/vod/from/gsm3u8/"}
]},
"read":{"sites":[
{"key":"zzmusic_book_open","name":"渣渣音乐","type":10,"api":"assets://js/zzmusic_book_open.js"},
{"key":"zz123_book_open","name":"123听歌","type":10,"api":"assets://js/zz123_book_open.js"},
{"key":"230ts","name":"爱上你听书","type":10,"api":"assets://js/230ts_book_open.js"},
{"key":"laobaigushi","name":"老白故事","type":10,"api":"assets://js/lbgs_open.js"},
+277
View File
@@ -0,0 +1,277 @@
import { Crypto, load, _ } from 'assets://js/lib/cat.js';
let key = 'star';
let host = 'https://www.histar.tv';
let apiHost = 'https://aws.ulivetv.net';
let types = {};
// let ver = '';
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, method, data) {
const headers = {
'User-Agent': UA,
};
if (method == 'post') {
headers['Content-Type'] = 'application/json';
} else {
headers['Cookie'] = 'userIP=127.0.0.1; aws-waf-token=';
headers['Referer'] = host;
}
const res = await req(reqUrl, {
method: method || 'get',
headers: headers,
data: data,
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
types = {
'movie': '电影',
'drama': '电视剧',
'animation': '动漫',
'variety': '综艺',
'documentary': '纪录片',
};
// ver = await getVer();
}
// async function getVer() {
// const html = await request(host);
// const $ = load(html);
// const srcAttr = $('script[src*=\'buildManifest.js\']').attr('src');
// return srcAttr.split('/')[3];
// }
async function home(filter) {
const typeList = _.keys(types);
const classes = _.map(typeList, (item) => {
return { type_id: item, type_name: types[item] };
});
const filterConfig = {};
const jsonData = JSON.stringify(typeList);
for (const typeId of typeList) {
const html = await request(host + '/' + typeId + '/all/all/all');
const $ = load(html);
const json = $('#__NEXT_DATA__')[0].children[0].data;
const obj = JSON.parse(json).props.pageProps.filterCondition;
const label = convertTypeData(obj, 'label', '类型');
const country = convertTypeData(obj, 'country', '地区');
const time = convertTypeData(obj, 'time', '年份');
const filterArray = [label, country, time];
filterConfig[typeId] = filterArray;
};
return JSON.stringify({
class: classes,
filters: filterConfig,
});
}
function convertTypeData(typeData, key, name) {
if (!typeData || !typeData[key] || typeData[key].length <= 2) {
return null;
}
let valueList = typeData[key];
if (key == 'time') {
valueList = valueList.sort((a, b) => { return b - a;});
valueList.pop();
}
const values = _.map(valueList, (item) => {
let name;
let value;
if (item instanceof Array) {
name = item[0];
value = item[0];
} else {
name = item.toString();
value = item.toString();
}
return {
n: name,
v: value,
};
});
values.unshift({
n: '全部',
v: '',
});
const typeClass = {
key: key,
name: name,
init: '',
value: values,
};
return typeClass;
}
async function homeVod() {
const html = await request(host);
const $ = load(html);
const json = $('#__NEXT_DATA__')[0].children[0].data;
const obj = JSON.parse(json).props.pageProps.cards;
const videos = [];
_.each(obj, (cards) => {
if (cards.name == '电视直播') return;
_.each(cards.cards, (card) => {
const v = {
vod_id: card.id,
vod_name: card.name,
vod_pic: card.img,
vod_remarks: card.countStr,
};
videos.push(v);
});
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
const limit = 16;
const param = {
chName: types[tid],
page: pg,
pageSize: limit,
label: extend.label,
country: extend.country,
};
if (extend.time) {
const year = parseInt(extend.time);
param.startTime = year;
param.endTime = year;
}
const json = await request(apiHost + '/v3/web/api/filter', 'post', JSON.stringify(param));
const data = JSON.parse(json).data;
const videos = _.map(data.list, (card) => {
return {
vod_id: card.id,
vod_name: card.name,
vod_pic: card.img,
vod_remarks: card.countStr,
};
});
const page = parseInt(pg);
const count = parseInt(data.total / limit);
return JSON.stringify({
page: page,
pagecount: count,
limit: limit,
total: data.total,
list: videos,
});
}
async function detail(id) {
const html = await request(host + '/vod/detail/' + id);
const $ = load(html);
const json = $('#__NEXT_DATA__')[0].children[0].data;
const obj = JSON.parse(json).props.pageProps;
const vObj = obj.pageData;
const vodAtom = {
vod_id: id,
vod_name: vObj.name,
vod_type: vObj.chname,
vod_pic: vObj.picurl,
vod_area: vObj.country,
vod_lang: vObj.language,
vod_remarks: vObj.countStr,
vod_actor: vObj.actor,
vod_director: vObj.director,
vod_content: vObj.desc,
}
const playInfo = obj.videosGroup;
const playVod = {};
_.each(playInfo, (info) => {
const sourceName = info.name;
let playList = '';
const videoInfo = info.videos;
const vodItems = _.map(videoInfo, (epObj) => {
const epName = epObj.epInfo;
const playUrl = epObj.purl
return epName + '$' + playUrl;
});
if (_.isEmpty(vodItems)) return;
playList = vodItems.join('#');
playVod[sourceName] = playList;
});
vodAtom.vod_play_from = _.keys(playVod).join('$$$');
vodAtom.vod_play_url = _.values(playVod).join('$$$');
return JSON.stringify({
list: [vodAtom],
});
}
async function play(flag, id, flags) {
let playUrl = id;
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
async function search(wd, quick, pg) {
// const limit = 10;
// const json = await request(host + '/_next/data/' + ver + '/search.json?word=' + encodeURIComponent(wd) + '&page=' + pg);
// const data = JSON.parse(json).pageProps;
// const videos = _.map(data.initList, (card) => {
// return {
// vod_id: card.id,
// vod_name: card.name,
// vod_pic: card.picurl,
// vod_remarks: card.countStr,
// };
// });
// const page = parseInt(pg);
// const count = parseInt(data.total / limit);
// return JSON.stringify({
// page: page,
// pagecount: count,
// limit: limit,
// total: data.total,
// list: videos,
// });
const limit = 10;
const param = {
word: wd,
page: pg,
pageSize: limit,
};
const json = await request(apiHost + '/v3/web/api/search', 'post', JSON.stringify(param));
const data = JSON.parse(json).data;
const videos = _.map(data.list, (card) => {
return {
vod_id: card.id,
vod_name: card.name,
vod_pic: card.picurl,
vod_remarks: card.countStr,
};
});
const page = parseInt(pg);
const count = parseInt(data.total / limit);
return JSON.stringify({
page: page,
pagecount: count,
limit: limit,
total: data.total,
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}
+271
View File
@@ -0,0 +1,271 @@
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,
});
}
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,
};
}
+162
View File
@@ -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,
};
}
+163
View File
@@ -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,
};
}