Add files via upload

This commit is contained in:
n3rddd 2024-01-14 18:08:15 +08:00 committed by GitHub
parent 284c24d87a
commit 145a89e125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 1648 additions and 353 deletions

View File

@ -1,9 +1,35 @@
## Debug with any js debugger.
## Support using private Gitee or GitHub repositories as remote config.
* github://<your personal access token>@github.com/<owner>/<repo>/<ref>/<file path>
* gitee://<your access token>@gitee.com/<owner>/<repo>/<ref>/<file path>
* github://ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com/catvod/TestCfg/main/config_open.json
* gitee://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@gitee.com/catvod/test-cfg/master/config_open.json
`npm install`
`node test.js`
## personal access token
* Settings > Developer settings > Personal access tokens > Token (classic) > Generate new token
* Settings > Developer settings > Personal access tokens > Fine-grained tokens > Generate new token
`node build.js`
**Don't import `wrapper\index.js` direct.**
## 远端配置:
* github://ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com/YuanHsing/CatVodOpen/main/js/config_open2.json
* github://github_pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com/YuanHsing/CatVodOpen/main/js/config_open2.json
## 本地配置:
* assets://js/config_open.json
## 参考教程:
* https://omii.top/1296.html
## 添加格式:
{
"key": "pan99",
"name": "🟢 盘九",
"type": 3,
"api": "./pan99_open.js",
"ext": "填入阿里token"
},
//"key"、"name" 内:与其他不重复的名称均可。
//"type" 3为影视10为有声读物
//"api" 填写js路径"ext" 填写扩展内容例如玩偶的token。

View File

@ -0,0 +1,167 @@
import { Crypto, load, _ } from './lib/cat.js';
let key = 'rttks';
let HOST = 'https://www.rttks.com';
let siteKey = '';
let siteType = 0;
const UA = 'Mozilla/5.0 (Linux; Android 10; HLK-AL00 Build/HONORHLK-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.93 Mobile Safari/537.36';
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || UA,
'Referer': HOST
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
async function home(filter) {
let classes = [{"type_id":"dianying","type_name":"电影"},{"type_id":"dianshiju","type_name":"追剧"},{"type_id":"zongyi","type_name":"综艺"},{"type_id":"dongman","type_name":"动漫"},{"type_id":"jilupian","type_name":"动漫"}];
let filterObj = {
"dianying":[{"key":"cateId","name":"类型","value":[{"n":"全部","v":"dianying"},{"n":"剧情","v":"jqp"},{"n":"喜剧","v":"xjp"},{"n":"动作","v":"dzp"},{"n":"爱情","v":"aqp"},{"n":"科幻","v":"khp"},{"n":"恐怖","v":"kbp"},{"n":"战争","v":"zzp"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"/area/大陆"},{"n":"中国香港","v":"/area/香港"},{"n":"中国台湾","v":"/area/台湾"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"澳大利亚","v":"/area/澳大利亚"}]},{"key":"year","name":"时间","value":[{"n":"全部","v":""},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
"dianshiju":[{"key":"cateId","name":"类型","value":[{"n":"全部","v":"dianshiju"},{"n":"国产剧","v":"gcj"},{"n":"港台剧","v":"gtj"},{"n":"日韩剧","v":"rhj"},{"n":"海外剧","v":"hwj"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"/area/大陆"},{"n":"中国香港","v":"/area/香港"},{"n":"中国台湾","v":"/area/台湾"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"澳大利亚","v":"/area/澳大利亚"}]},{"key":"year","name":"时间","value":[{"n":"全部","v":""},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
"dongman":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"/area/大陆"},{"n":"中国香港","v":"/area/香港"},{"n":"中国台湾","v":"/area/台湾"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"澳大利亚","v":"/area/澳大利亚"}]},{"key":"year","name":"时间","value":[{"n":"全部","v":""},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
"zongyi":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"/area/大陆"},{"n":"中国香港","v":"/area/香港"},{"n":"中国台湾","v":"/area/台湾"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"澳大利亚","v":"/area/澳大利亚"}]},{"key":"year","name":"时间","value":[{"n":"全部","v":""},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
"jilupian":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"/area/大陆"},{"n":"中国香港","v":"/area/香港"},{"n":"中国台湾","v":"/area/台湾"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"澳大利亚","v":"/area/澳大利亚"}]},{"key":"year","name":"时间","value":[{"n":"全部","v":""},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}]
};
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
if (pg <= 0) pg = 1;
const link = HOST + '/rrtop/' + (extend.cateId || tid) + (extend.area || '') + (extend.by || '/by/time') + '/page/' + pg + (extend.year || '') + '.html';//https://www.rttks.com/rrtop/dzp/area/%E7%BE%8E%E5%9B%BD/class//page/2/year/2022.html
const html = await request(link);
const $ = load(html);
const items = $('ul.stui-vodlist li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const remarks = $($(item).find('span.pic-text text-right')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/rrtv\/(.*).html/g, '$1'),
vod_name: it.attribs.title,
vod_pic: it.attribs['data-original'],
vod_remarks: remarks || '',
};
});
const hasMore = $('ul.stui-page > li > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
async function detail(id) {
const html = await request( HOST + '/rrtv/' + id + '.html');
const $ = load(html);
const vod = {
vod_id: id,
vod_name: $('.col-md-wide-75 h2').text().trim(),
vod_type: $('.stui-content__detail p:nth-child(4)').text(),
vod_actor: $('.stui-content__detail p:nth-child(2)').text().replace('上映:剧情:', ''),
vod_pic: $('.module-item-pic img:first').attr('data-src'),
vod_remarks : $('.stui-content__detail p:nth-child(5)').text() || '',
vod_content: $('.detail-content').text().trim(),
};
let playMap = {};
const tabs = $('body div.bottom-line h3.title');
const playlists = $('ul.stui-content__playlist');
_.each(tabs, (tab, i) => {
const from = tab.children[0].data;
let list = playlists[i];
list = $(list).find('a');
_.each(list, (it) => {
const title = it.children[0].data;
const playUrl = it.attribs.href.replace(/.*?\/rrplay\/(.*).html/g, '$1');
if (title.length == 0) title = it.children[0].data.trim();
if (!playMap.hasOwnProperty(from)) {
playMap[from] = [];
}
playMap[from].push( title + '$' + playUrl);
});
});
vod.vod_play_from = _.keys(playMap).join('$$$');
const urls = _.values(playMap);
let vod_play_url = _.map(urls, (urlist) => {
return urlist.join('#');
});
vod.vod_play_url = vod_play_url.join('$$$');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const link = HOST + '/rrplay/' + id + '.html';
const html = await request(link);
const $ = load(html);
const js = JSON.parse($('script:contains(player_)').html().replace('var player_aaaa=',''));
const playUrl = unescape(base64Decode(js.url));
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
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 search(wd, quick, pg) {
if (pg <= 0) pg = 1;
let data = await request(HOST + '/rrcz' + wd + '/page/' + pg + '.html');//https://www.rttks.com/rrcz%E6%88%91/page/2.html
const $ = load(data);
const items = $('ul.stui-vodlist__media li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const remarks = $($(item).find('span.pic-text text-right')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/rrtv\/(.*).html/g, '$1'),
vod_name: it.attribs.title,
vod_pic: it.attribs['data-original'],
vod_remarks: remarks || '',
};
});
const hasMore = $('ul.stui-page > li > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

View File

@ -0,0 +1,135 @@
// 搜索滑块验证
import { load, _ } from './lib/cat.js';
let key = '短视频';
let HOST = 'http://www.sharenice.net';
let siteKey = '';
let siteType = 0;
let PC_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36';
async function request(reqUrl, agentSp) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': agentSp || PC_UA,
},
});
return res.content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
}
function clsjoin(cls) {
_.each(cls, (s) => {
let typeId = s.attribs['href'];
typeId = typeId.substring(typeId.lastIndexOf('t/') + 2);
classes.push({
type_id: typeId,
type_name: s.children[0].data,
});
});
}
let classes = [];
async function home(filter) {
let filterObj = {};
let html = await request(HOST);
let $ = load(html);
let series = $('div.nav > ul > li > a[href*=net/]');
let tag = $('div.hot-tags-list > a[href*=net]');
clsjoin(series);
clsjoin(tag);
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
let link = HOST + '/t-576O5aWz';
let html = await request(link);
let $ = load(html);
let items = $('div.item-box ul li');
let videos = _.map(items, (item) => {
let a = $(item).find('a:first')[0];
let img = $(item).find('img:first')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: '',
};
});
return JSON.stringify({
list: videos,
});
}
async function category(tid, pg, filter, extend) {
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
let link = HOST + '/' + tid + '?page=' + pg;
let html = await request(link);
let $ = load(html);
let items = $('div.item-box ul li');
let videos = _.map(items, (item) => {
let a = $(item).find('a:first')[0];
let img = $(item).find('img:first')[0];
return {
vod_id: a.attribs.href,
vod_name: a.attribs.title,
vod_pic: img.attribs['data-original'],
vod_remarks: '',
};
});
let hasMore = $('ul.pagination > li > a:contains(»)').length > 0;
let pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 16,
total: 16 * pgCount,
list: videos,
});
}
async function detail(id) {
let vod = {
vod_id: id,
vod_remarks: '',
};
let playlist = ['观看视频' + '$' + id];
vod.vod_play_from = '道长在线';
vod.vod_play_url = playlist.join('#');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
let html = await request(id);
let $ = load(html);
let playUrl = $('div.video-play-box').find('video:first')[0].attribs.src + '#.mp4';
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
async function search(wd, quick, pg) {
return '{}';
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

File diff suppressed because one or more lines are too long

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

View File

@ -1,51 +1,58 @@
import { __jsEvalReturn } from './kunyu77_open.js';
var spider = __jsEvalReturn();
async function test() {
var spType = null;
var spVid = null;
spType = '2';
// spVid = '95873';
await spider.init({ skey: 'siteKey', ext: '' });
var classes = JSON.parse(await spider.home(true));
console.log(classes);
var homeVod = JSON.parse(await spider.homeVod());
console.log(homeVod);
if (classes.class && classes.class.length > 0) {
var page = JSON.parse(await spider.category(spType || classes.class[0].type_id, 0, undefined, {}));
console.log(page);
if (page.list && page.list.length > 0) {
for (const k in page.list) {
if (k >= 5) break;
var detail = JSON.parse(await spider.detail(spVid || page.list[k].vod_id));
console.log(detail);
if (detail.list && detail.list.length > 0) {
var pFlag = detail.list[0].vod_play_from.split('$$$');
var pUrls = detail.list[0].vod_play_url.split('$$$');
if (pFlag.length > 0 && pUrls.length > 0) {
for (const i in pFlag) {
var flag = pFlag[i];
var urls = pUrls[i].split('#');
if (urls.length > 0) {
var url = urls[0].split('$')[1];
console.log(flag, url);
var playUrl = await spider.play(flag, url, []);
console.log(playUrl);
}
}
}
}
if (spVid) break;
}
}
}
var search = JSON.parse(await spider.search('奥特曼'));
console.log(search);
search = JSON.parse(await spider.search('喜欢'));
console.log(search);
}
export { test };
import { __jsEvalReturn } from './kunyu77_open.js';
var spider = __jsEvalReturn();
function jsonParse(obj) {
if (typeof obj === 'string') {
return JSON.parse(obj);
}
return obj;
}
async function test() {
var spType = null;
var spVid = null;
spType = '2';
// spVid = '95873';
await spider.init({ skey: 'siteKey', ext: '' });
var classes = jsonParse(await spider.home(true));
console.log(classes);
var homeVod = jsonParse(await spider.homeVod());
console.log(homeVod);
if (classes.class && classes.class.length > 0) {
var page = jsonParse(await spider.category(spType || classes.class[0].type_id, 0, undefined, {}));
console.log(page);
if (page.list && page.list.length > 0) {
for (const k in page.list) {
if (k >= 5) break;
var detail = jsonParse(await spider.detail(spVid || page.list[k].vod_id));
console.log(detail);
if (detail.list && detail.list.length > 0) {
var pFlag = detail.list[0].vod_play_from.split('$$$');
var pUrls = detail.list[0].vod_play_url.split('$$$');
if (pFlag.length > 0 && pUrls.length > 0) {
for (const i in pFlag) {
var flag = pFlag[i];
var urls = pUrls[i].split('#');
if (urls.length > 0) {
var url = urls[0].split('$')[1];
console.log(flag, url);
var playUrl = await spider.play(flag, url, []);
console.log(playUrl);
}
}
}
}
if (spVid) break;
}
}
}
var search = jsonParse(await spider.search('奥特曼'));
console.log(search);
search = jsonParse(await spider.search('喜欢'));
console.log(search);
}
export { test };

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

View File

@ -0,0 +1,114 @@
import { Crypto, _ } from 'assets://js/lib/cat.js';
import { log } from './lib/utils.js';
import { initAli, detailContent, playContent } from './lib/ali.js';
let siteKey = 'upyun';
let siteType = 0;
let siteUrl = 'https://zyb.upyunso.com';
let patternAli = /(https:\/\/www\.(aliyundrive|alipan)\.com\/s\/[^"]+)/
async function request(reqUrl) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'Referer': siteUrl,
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
await initAli(cfg);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function home(filter) {
return '{}';
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
return '{}';
}
async function detail(id) {
try {
return await detailContent(id);
} catch (e) {
await log('detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log('play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick, pg) {
if (pg <= 0) pg = 1;
const limit = 25;
const resp = await request(siteUrl + "/v15/search?keyword=" + encodeURIComponent(wd) + '&page=' + pg + '&s_type=2');
const data = decrypt(resp);
const items = JSON.parse(data).result.items;
const videos = [];
for(const item of items) {
const url = decrypt(item.page_url);
const matches = url.match(patternAli);
if (_.isEmpty(matches)) continue;
const title = _.isEmpty(item.content) ? item.title : item.content[0].title;
videos.push({
vod_id: url,
vod_name: title.replaceAll(/<\/?[^>]+>/g, ""),
vod_pic: "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
vod_remarks: item.insert_time,
});
}
const hasMore = !_.isEmpty(items);
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: limit,
total: limit * pgCount,
list: videos,
});
}
function decrypt(text) {
const data = {
ciphertext: Crypto.enc.Hex.parse(text.toUpperCase()),
};
const key = Crypto.enc.Utf8.parse('qq1920520460qqzz');
const iv = Crypto.enc.Utf8.parse('qq1920520460qqzz');
const mode = Crypto.mode.CBC;
const padding = Crypto.pad.Pkcs7;
const decrypted = Crypto.AES.decrypt(data, key, {
'iv': iv,
'mode': mode,
'padding': padding
});
const decryptedData = Crypto.enc.Utf8.stringify(decrypted);
return decryptedData;
}
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

View File

@ -0,0 +1,171 @@
import {load, _, Uri} from 'assets://js/lib/cat.js';
import {log} from './lib/utils.js';
import {initAli, detailContent, playContent} from './lib/ali.js';
let siteKey = 'wobg';
let siteType = 0;
let siteUrl = 'https://wobge.run.goorm.io';
let UA = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
let patternAli = /(https:\/\/www\.(aliyundrive|alipan)\.com\/s\/[^"]+)/
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
await initAli(cfg.ext);
} catch (e) {
console.debug('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function request(reqUrl, agentSp) {
let header = {
'user-agent': agentSp || 'okhttp/3.12.0',
};
let uri = new Uri(reqUrl);
let res = await req(uri.toString(), {
headers: header,
timeout: 10000
});
let content = res.content;
return content;
}
function getHeader() {
let header = {};
header['User-Agent'] = UA;
return header;
}
async function getString(url) {
let res = await req(url, {
headers: getHeader()
});
return res.content;
}
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':'5','type_name':'音乐'},{'type_id':'44','type_name':'自营短剧'}];
let filterObj = {
'1':[{'key':'cateId','name':'类型','init':'1','value':[{'n':'全部','v':'1'},{'n':'大陆自营电影','v':'6'},{'n':'香港自营电影','v':'7'},{'n':'台湾自营电影','v':'8'},{'n':'美国自营电影','v':'9'},{'n':'法国自营电影','v':'10'},{'n':'英国自营电影','v':'11'},{'n':'日本自营电影','v':'12'},{'n':'韩国自营电影','v':'20'},{'n':'德国自营电影','v':'21'}]},{'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':'lang','name':'语言','init':'','value':[{'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':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
'2':[{'key':'cateId','name':'类型','init':'2','value':[{'n':'全部','v':'2'},{'n':'大陆自营剧集','v':'13'},{'n':'香港自营剧集','v':'14'},{'n':'台湾自营剧集','v':'15'},{'n':'美国自营剧集','v':'16'},{'n':'法国自营剧集','v':'22'},{'n':'英国自营剧集','v':'23'},{'n':'日本自营剧集','v':'24'},{'n':'韩国自营剧集','v':'25'},{'n':'德国自营剧集','v':'26'}]},{'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':'其他'}]},{'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':'其他'}]},{'key':'lang','name':'语言','init':'','value':[{'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'},{'n':'2009','v':'2009'},{'n':'2008','v':'2008'},{'n':'2007','v':'2007'},{'n':'2006','v':'2006'},{'n':'2005','v':'2005'},{'n':'2004','v':'2004'}]},{'key':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
'3':[{'key':'cateId','name':'类型','init':'3','value':[{'n':'全部','v':'3'},{'n':'大陆动漫','v':'27'},{'n':'香港动漫','v':'28'},{'n':'台湾动漫','v':'29'},{'n':'美国动漫','v':'30'},{'n':'法国动漫','v':'31'},{'n':'英国动漫','v':'32'},{'n':'日本动漫','v':'33'},{'n':'韩国动漫','v':'34'},{'n':'德国动漫','v':'35'}]},{'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':'求职'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'内地','v':'内地'},{'n':'港台','v':'港台'},{'n':'日韩','v':'日韩'},{'n':'欧美','v':'欧美'}]},{'key':'lang','name':'语言','init':'','value':[{'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'},{'n':'2009','v':'2009'},{'n':'2008','v':'2008'},{'n':'2007','v':'2007'},{'n':'2006','v':'2006'},{'n':'2005','v':'2005'},{'n':'2004','v':'2004'}]},{'key':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
'4':[{'key':'cateId','name':'类型','init':'4','value':[{'n':'全部','v':'4'},{'n':'大陆综艺','v':'36'},{'n':'香港综艺','v':'37'},{'n':'台湾综艺','v':'38'},{'n':'美国综艺','v':'39'},{'n':'法国综艺','v':'40'},{'n':'英国综艺','v':'41'},{'n':'日本综艺','v':'42'},{'n':'韩国综艺','v':'43'}]},{'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':'其他'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'国产','v':'国产'},{'n':'日本','v':'日本'},{'n':'欧美','v':'欧美'},{'n':'其他','v':'其他'}]},{'key':'lang','name':'语言','init':'','value':[{'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'},{'n':'2009','v':'2009'},{'n':'2008','v':'2008'},{'n':'2007','v':'2007'},{'n':'2006','v':'2006'},{'n':'2005','v':'2005'},{'n':'2004','v':'2004'}]},{'key':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
'5':[{'key':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
'44':[{'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':'其他'}]},{'key':'area','name':'地区','init':'','value':[{'n':'全部','v':''},{'n':'内地','v':'内地'}]},{'key':'lang','name':'语言','init':'','value':[{'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'},{'n':'2009','v':'2009'},{'n':'2008','v':'2008'},{'n':'2007','v':'2007'},{'n':'2006','v':'2006'},{'n':'2005','v':'2005'},{'n':'2004','v':'2004'}]},{'key':'letter','name':'字母','init':'','value':[{'n':'全部','v':''},{'n':'A','v':'A'},{'n':'B','v':'B'},{'n':'C','v':'C'},{'n':'D','v':'D'},{'n':'E','v':'E'},{'n':'F','v':'F'},{'n':'G','v':'G'},{'n':'H','v':'H'},{'n':'I','v':'I'},{'n':'J','v':'J'},{'n':'K','v':'K'},{'n':'L','v':'L'},{'n':'M','v':'M'},{'n':'N','v':'N'},{'n':'O','v':'O'},{'n':'P','v':'P'},{'n':'Q','v':'Q'},{'n':'R','v':'R'},{'n':'S','v':'S'},{'n':'T','v':'T'},{'n':'U','v':'U'},{'n':'V','v':'V'},{'n':'W','v':'W'},{'n':'X','v':'X'},{'n':'Y','v':'Y'},{'n':'Z','v':'Z'},{'n':'0-9','v':'0-9'}]},{'key':'by','name':'排序','value':[{'n':'时间','v':'time'},{'n':'人气','v':'hits'},{'n':'评分','v':'score'}]}],
};
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {
return '{}';
}
async function category(tid, pg, filter, extend) {
if (pg <= 0) pg = 1;
const clazz = getFilterUrlPart(extend, 'class');
const area = getFilterUrlPart(extend, 'area');
const by = getFilterUrlPart(extend, 'by');
const lang = getFilterUrlPart(extend, 'lang');
const letter = getFilterUrlPart(extend, 'letter');
const year = getFilterUrlPart(extend, 'year');
let reqUrl = siteUrl + '/index.php/vod/show' + area + by + clazz + '/id/' + (extend.cateId || tid) + lang + '/page/' + pg + letter + year + '.html';
let con = await request(reqUrl, UA);
const $ = load(con);
let items = $('.module:eq(0) > .module-list > .module-items > .module-item');
let videos = [];
for(var item of items) {
let oneA = $(item).find('.module-item-cover .module-item-pic a').first();
let href = oneA.attr('href');
let name = oneA.attr('title');
let oneImg = $(item).find('.module-item-cover .module-item-pic img').first();
let pic = oneImg.attr('data-src');
let remark = $(item).find('.module-item-text').first().text();
videos.push({
vod_id: href,
vod_name: name,
vod_pic: pic,
vod_remarks: remark,
});
}
const hasMore = $('#page > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 72,
total: 72 * pgCount,
list: videos,
});
}
function getFilterUrlPart(extend, part) {
let result = '';
if (extend[part]) {
result = '/' + part + '/' + extend[part];
}
return result;
}
async function detail(id) {
try {
await log('detail:id:' + id);
let preMatches = id.match(patternAli);
if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]);
let url = siteUrl + id;
let aliUrl = await getString(url);
let matches = aliUrl.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return '';
} catch (e) {
console.debug( 'detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
console.debug( 'play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick) {
await log('search' + wd);
let searchUrl = siteUrl + '/index.php/vod/search.html?wd=' + wd;
let html = await getString(searchUrl);
let $ = load(html);
let items = $('.module-search-item');
let videos = [];
for(var item of items) {
let vodId = $(item).find(".video-serial")[0].attribs.href;
let name = $(item).find(".video-serial")[0].attribs.title;
let pic = $(item).find(".module-item-pic > img")[0].attribs['data-src'];
let remark = '';
videos.push({
vod_id: vodId,
vod_name: name,
vod_pic: pic,
vod_remarks: remark,
});
}
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

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

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,113 @@
import { load, _ } from 'assets://js/lib/cat.js';
import { log } from './lib/utils.js';
import { initAli, detailContent, playContent } from './lib/ali.js';
let siteKey = 'xiaozhitiao';
let siteType = 0;
let siteUrl = 'https://gitcafe.net/tool/alipaper/';
let aliUrl = "https://www.aliyundrive.com/s/";
let token = '';
let date = new Date();
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function request(reqUrl, data) {
let res = await req(reqUrl, {
method: 'post',
headers: {
'User-Agent': UA,
},
data: data,
postType: 'form',
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
await initAli(cfg);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function home(filter) {
return '{}';
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
return '{}';
}
async function detail(id) {
try {
return await detailContent(id);
} catch (e) {
await log('detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log('play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick, pg) {
if (pg <= 0) pg = 1;
const params = {
"action": "search",
"from": "web",
"keyword": wd,
"token": await getToken(),
};
const resp = await request(siteUrl, params);
const json = JSON.parse(resp);
if (!json.success) return "";
const videos = _.map(json.data, (item) => {
return {
vod_id: aliUrl + item.alikey,
vod_name: item.title,
vod_pic: "https://www.lgstatic.com/i/image2/M01/15/7E/CgoB5lysLXCADg6ZAABapAHUnQM321.jpg",
vod_remarks: item.creatime
};
});
return JSON.stringify({
list: videos,
});
}
async function getToken() {
const newDate = new Date();
if (_.isEmpty(token) || newDate > date) {
const params = {
"action": "get_token",
};
const resp = await request(siteUrl, params);
const json = JSON.parse(resp);
if (json.success) {
token = json.data;
date = newDate;
}
}
return token;
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

View File

@ -0,0 +1,127 @@
import { Crypto, _ } from 'assets://js/lib/cat.js';
import { log } from './lib/utils.js';
import { initAli, detailContent, playContent } from './lib/ali.js';
let siteKey = 'yiso';
let siteType = 0;
let siteUrl = 'https://yiso.fun';
let patternAli = /(https:\/\/www\.(aliyundrive|alipan)\.com\/s\/[^"]+)/;
let cookie = '';
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) {
let res = await req(reqUrl, {
method: 'get',
headers: {
'User-Agent': UA,
'Referer': siteUrl,
'Cookie': cookie,
},
});
return res.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
const ext = _.isEmpty(cfg.ext) ? '' : cfg.ext;
const configs = ext.split('$$$');
if (configs.length == 2) {
cookie = configs[1];
}
const token = {
ext: configs[0]
};
await initAli(token);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function home(filter) {
return '{}';
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
return '{}';
}
async function detail(id) {
try {
let matches = id.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[0]);
return '';
} catch (e) {
await log('detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log('play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick, pg) {
if (pg <= 0) pg = 1;
const limit = 10;
const resp = await request(siteUrl + "/api/search?name=" + encodeURIComponent(wd) + '&pageNo=' + pg + '&from=ali');
const json = JSON.parse(resp).data;
const total = json.total;
const videos = _.map(json.list, (item) => {
const name = item.fileInfos[0].fileName;
const remark = item.gmtCreate;
const url = decryptUrl(item.url);
return {
vod_id: url,
vod_name: name,
vod_pic: "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
vod_remarks: remark,
};
});
const pgCount = parseInt(total / limit) + 1;
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: limit,
total: total,
list: videos,
});
}
function decryptUrl(url) {
const data = {
ciphertext: Crypto.enc.Base64.parse(url),
};
const key = Crypto.enc.Utf8.parse('4OToScUFOaeVTrHE');
const iv = Crypto.enc.Utf8.parse('9CLGao1vHKqm17Oz');
const mode = Crypto.mode.CBC;
const padding = Crypto.pad.Pkcs7;
const decrypted = Crypto.AES.decrypt(data, key, {
'iv': iv,
'mode': mode,
'padding': padding
});
const decryptedUrl = Crypto.enc.Utf8.stringify(decrypted);
return decryptedUrl;
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

View File

@ -0,0 +1,149 @@
import { Crypto, load, _, jinja2 } from './lib/cat.js';
let key = 'yjys';
let HOST = 'https://m.7caa.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': HOST
},
});
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":"动漫"}];
let filterObj = {
"1":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"喜剧","v":"喜剧"},{"n":"爱情","v":"爱情"},{"n":"恐怖","v":"恐怖"},{"n":"动作","v":"动作"},{"n":"科幻","v":"科幻"},{"n":"剧情","v":"剧情"},{"n":"战争","v":"战争"},{"n":"警匪","v":"警匪"},{"n":"犯罪","v":"犯罪"},{"n":"动画","v":"动画"},{"n":"奇幻","v":"奇幻"},{"n":"武侠","v":"武侠"},{"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"}]}],
"2":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春偶像","v":"青春偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"动作","v":"动作"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"历史","v":"历史"},{"n":"经典","v":"经典"},{"n":"乡村","v":"乡村"},{"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":"其他"}]},{"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":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]}],
"3":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"选秀","v":"选秀"},{"n":"情感","v":"情感"},{"n":"访谈","v":"访谈"},{"n":"播报","v":"播报"},{"n":"旅游","v":"旅游"},{"n":"音乐","v":"音乐"},{"n":"美食","v":"美食"},{"n":"纪实","v":"纪实"},{"n":"曲艺","v":"曲艺"},{"n":"生活","v":"生活"},{"n":"游戏互动","v":"游戏互动"},{"n":"财经","v":"财经"},{"n":"求职","v":"求职"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"}]},{"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"}]}],
"4":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"情感","v":"情感"},{"n":"科幻","v":"科幻"},{"n":"热血","v":"热血"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":"冒险"},{"n":"萝莉","v":"萝莉"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":"社会","v":"社会"},{"n":"原创","v":"原创"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"国产","v":"国产"},{"n":"日本","v":"日本"},{"n":"欧美","v":"欧美"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]}]
};
return JSON.stringify({
class: classes,
filters: filterObj,
});
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
if (pg <= 0) pg = 1;
const link = HOST + '/vshow/' + tid + '-' + (extend.area || '') + '--' + (extend.class || '') + '-----' + pg + '---' + (extend.year || '') + '.html';//https://m.7caa.com/vshow/1-%E7%BE%8E%E5%9B%BD--%E7%88%B1%E6%83%85-----2---2020.html
const html = await request(link);
const $ = load(html);
const items = $('ul.stui-vodlist > li');
let videos = _.map(items, (item) => {
const it = $(item).find('a:first')[0];
const remarks = $($(item).find('span.pic-text text-right')[0]).text().trim();
return {
vod_id: it.attribs.href.replace(/.*?\/vod\/(.*).html/g, '$1'),
vod_name: it.attribs.title,
vod_pic: it.attribs['data-original'],
vod_remarks: remarks || '',
};
});
const hasMore = $('ul.stui-page > li > a:contains(下一页)').length > 0;
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: 24,
total: 24 * pgCount,
list: videos,
});
}
async function detail(id) {
var html = await request( HOST + '/play/' + id + '-1-1' + '.html');
var $ = load(html);
var vod = {
vod_id: id,
vod_name: $('h1:first').text().trim(),
vod_type: $('.stui-content__detail p:first a').text(),
vod_actor: $('.stui-content__detail p:nth-child(3)').text().replace('主演:',''),
vod_pic: $('.stui-content__thumb img:first').attr('data-original'),
vod_remarks : $('.stui-content__detail p:nth-child(5)').text() || '',
vod_content: $('span.detail-content').text().trim(),
};
var playMap = {};
var tabs = $('ul.dropdown-menu > li > a');
var playlists = $('ul.stui-content__playlist');
_.each(tabs, (tab, i) => {
var from = tab.children[0].data;
var list = playlists[i];
list = $(list).find('a');
_.each(list, (it) => {
var title = it.children[0].data;
var playUrl = it.attribs.href.replace(/\/play\/(.*).html/g, '$1');
if (title.length == 0) title = it.children[0].data.trim();
if (!playMap.hasOwnProperty(from)) {
playMap[from] = [];
}
playMap[from].push( title + '$' + playUrl);
});
});
vod.vod_play_from = _.keys(playMap).join('$$$');
var urls = _.values(playMap);
var vod_play_url = _.map(urls, (urlist) => {
return urlist.join('#');
});
vod.vod_play_url = vod_play_url.join('$$$');
return JSON.stringify({
list: [vod],
});
}
async function play(flag, id, flags) {
const link = HOST + '/play/' + id + '.html';
const html = await request(link);
const $ = load(html);
const js = JSON.parse($('script:contains(player_)').html().replace('var player_aaaa=',''));
const playurl = js.url;
const playUrl = unescape(playurl);
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
async function search(wd, quick) {
let data = JSON.parse(await request(HOST + '/index.php/ajax/suggest?mid=1&wd=' + wd)).list;
let videos = [];
for (const vod of data) {
videos.push({
vod_id: vod.id,
vod_name: vod.name,
vod_pic: vod.pic,
vod_remarks: '',
});
}
return JSON.stringify({
list: videos,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

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

View File

@ -0,0 +1,133 @@
import { load, _ } from 'assets://js/lib/cat.js';
import { log } from './lib/utils.js';
import { initAli, detailContent, playContent } from './lib/ali.js';
let siteKey = 'yunpan4k';
let siteType = 0;
let siteUrl = 'https://www.codelicence.cn';
let patternAli = /(https:\/\/www\.(aliyundrive|alipan)\.com\/s\/[^"]+)/;
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function requestRaw(reqUrl, method, data, redirect) {
let res = await req(reqUrl, {
method: method || 'get',
headers: {
'User-Agent': UA,
'Referer': siteUrl,
},
data: data,
postType: method === 'post' ? 'form' : '',
redirect: redirect == 0 ? 0 : 1,
});
return res;
}
async function request(reqUrl, method, data) {
let resRaw = await requestRaw(reqUrl, method, data);
return resRaw.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
await initAli(cfg.ext);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function home(filter) {
return '{}';
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
return '{}';
}
async function detail(id) {
try {
let matches = id.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
const html = await request(siteUrl + id);
const $ = load(html);
const href = $('div.down a:first').attr('href');
const data = await requestRaw(siteUrl + href, 'get', null, 0);
const headers = data.headers;
let url = '';
if (headers.hasOwnProperty('location')) {
url = headers['location'];
}
matches = url.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return '';
} catch (e) {
await log('detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log('play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick, pg) {
if (pg <= 0) pg = 1;
const limit = 20;
const param = {
keyboard: wd,
};
const data = await requestRaw(siteUrl + '/search', 'post', param);
let html = '';
const headers = data.headers;
if (headers.hasOwnProperty('location')) {
const url = headers['location'] + '?p=' + pg;
html = await request(url);
}
const $ = load(html);
const elements = $('ul#url');
const videos = _.map(elements, (item) => {
const element = $(item);
const href = element.find('a.l').attr('href');
if (!href) return undefined;
const name = element.text().trim();
const remark = element.find('li.r').attr('data_size');
console.debug('vod_id:' + href);
return {
vod_id: href,
vod_name: name,
vod_pic: "https://pic.rmb.bdstatic.com/bjh/6a2278365c10139b5b03229c2ecfeea4.jpeg",
vod_remarks: remark,
};
});
const nextPage = $('.pages_search .nex:contains(下一页)');
const hasMore = !_.isEmpty(nextPage);
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: limit,
total: limit * pgCount,
list: videos.filter(item => item !== undefined),
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
homeVod: homeVod,
category: category,
detail: detail,
play: play,
search: search,
};
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,153 @@
import { load, _ } from 'assets://js/lib/cat.js';
import { log } from './lib/utils.js';
import { initAli, detailContent, playContent } from './lib/ali.js';
let siteKey = 'zhaozy';
let siteType = 0;
let siteUrl = 'https://zhaoziyuan.pw';
let patternAli = /(https:\/\/www\.(aliyundrive|alipan)\.com\/s\/[^"]+)/;
let patternVid = /(\\S+)/;
let username = '';
let password = '';
let cookie = '';
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
async function requestRaw(reqUrl, headers, method, data) {
let res = await req(reqUrl, {
method: method || 'get',
headers: headers,
data: data,
postType: method === 'post' ? 'form' : '',
});
return res;
}
async function request(reqUrl, headers) {
let resRaw = await requestRaw(reqUrl, headers);
return resRaw.content;
}
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) {
try {
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey;
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype;
const ext = _.isEmpty(cfg.ext) ? '' : cfg.ext;
const configs = ext.split('$$$');
if (configs.length == 3) {
username = configs[1];
password = configs[2];
}
await initAli(configs[0]);
} catch (e) {
await log('init:' + e.message + ' line:' + e.lineNumber);
}
}
async function home(filter) {
return '{}';
}
async function homeVod() {}
async function category(tid, pg, filter, extend) {
return '{}';
}
async function detail(id) {
try {
let matches = id.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
const headers = await getHeaders();
const data = await request(siteUrl + '/' + id, headers);
matches = data.match(patternAli);
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return '';
} catch (e) {
await log('detail:' + e.message + ' line:' + e.lineNumber);
}
}
async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags);
} catch (e) {
await log('play:' + e.message + ' line:' + e.lineNumber);
}
}
async function search(wd, quick, pg) {
if (pg <= 0) pg = 1;
const limit = 15;
const headers = await getHeaders();
const html = await request(siteUrl + '/so?filename=' + encodeURIComponent(wd) + '&page=' + pg, headers);
const $ = load(html);
const elements = $('div.li_con div.news_text');
const videos = _.map(elements, (item) => {
const element = $(item);
const href = element.find('div.news_text a').attr('href');
if (!href) return undefined;
const matches = href.match(patternVid);
if (!_.isEmpty(matches)) return undefined;
const name = element.find("div.news_text a h3").text();
const remark = element.find("div.news_text a p").text().split("|")[1].split("")[1];
return {
vod_id: href,
vod_name: name,
vod_pic: "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
vod_remarks: remark
};
});
const nextPage = $('.page a li:contains(下一页)');
const hasMore = _.isEmpty(nextPage) ? false : nextPage.attr('class') != 'disabled';
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
return JSON.stringify({
page: parseInt(pg),
pagecount: pgCount,
limit: limit,
total: limit * pgCount,
list: videos.filter(item => item !== undefined),
});
}
async function getHeaders() {
if (!cookie) {
cookie = await getCookie();
}
return {
'User-Agent': UA,
'Referer': siteUrl,
'Cookie': cookie,
};
}
async function getCookie() {
const params = {
"username": username,
"password": password,
};
const headers = {
"User-Agent": UA,
"Referer": siteUrl + "/stop.html",
"Origin": siteUrl,
};
const res = await requestRaw(siteUrl + "/logiu.html", headers, 'post', params);
let result = '';
for (const cookie of res.headers['set-cookie']) {
result += cookie.split(";")[0] + ";";
}
return result;
}
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