Add files via upload
This commit is contained in:
parent
f208bae3ae
commit
b152a2db21
File diff suppressed because one or more lines are too long
@ -2,8 +2,8 @@
|
|||||||
import { Crypto, load, _ } from './lib/cat.js';
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
let key = 'czzy';
|
let key = 'czzy';
|
||||||
let host = 'https://www.czzy.site'; // 厂长地址发布页
|
let host = 'https://cz01.vip/'; // 厂长地址发布页
|
||||||
// let url = 'https://cz01.cc';
|
// let url = 'https://www.czz9.com';
|
||||||
let url = '';
|
let url = '';
|
||||||
let siteKey = '';
|
let siteKey = '';
|
||||||
let siteType = 0;
|
let siteType = 0;
|
||||||
|
408
cat/kkys_open.js
408
cat/kkys_open.js
@ -1,412 +1,8 @@
|
|||||||
import { Crypto, dayjs, jinja2, _ } from './lib/cat.js';
|
import{Crypto,dayjs,jinja2,_}from"assets://js/lib/cat.js";let key="kkys",url="https://api1.baibaipei.com:8899",device={},siteKey="",siteType=0;async function request(reqUrl,postData,agentSp,get){var ts=dayjs().valueOf().toString(),rand=randStr(32),sign=Crypto.MD5("abcdexxxdd2daklmn25129_"+ts+"_"+rand).toString().toLowerCase(),agentSp={"user-agent":agentSp||device.ua},sign=(reqUrl.includes("baibaipei")&&(agentSp["device-id"]=device.id,agentSp["push-token"]="",agentSp.sign=sign,agentSp.time=ts,agentSp.md5=rand,agentSp.version="2.1.3",agentSp["system-model"]=device.model,agentSp["system-brand"]=device.brand,agentSp["system-version"]=device.release),await req(reqUrl,{method:get?"get":"post",headers:agentSp,data:postData||{},postType:get?"":"form"}));return sign.content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype;cfg=await local.get(key,"device");if(0<cfg.length)try{device=JSON.parse(cfg)}catch(error){}_.isEmpty(device)&&((device=randDevice()).id=randStr(33).toLowerCase(),device.ua="okhttp/4.1.0",await local.set(key,"device",JSON.stringify(device)))}async function home(filter){var classes=[],filterObj={};for(const type of JSON.parse(await request(url+"/api.php/Index/getTopVideoCategory")).data){var typeName=type.nav_name;if("推荐"!=typeName){var typeId=type.nav_type_id.toString();if(classes.push({type_id:typeId,type_name:typeName}),filter)try{var key,filterAll=[],filterData=JSON.parse(await request(url+"/api.php/Video/getFilterType",{type:typeId})).data;for(key of Object.keys(filterData)){var itemValues=filterData[key];"plot"===key&&(key="class");let typeExtendName="";switch(key){case"class":typeExtendName="类型";break;case"area":typeExtendName="地区";break;case"lang":typeExtendName="语言";break;case"year":typeExtendName="年代";break;case"sort":typeExtendName="排序"}if(0!==typeExtendName.length){var newTypeExtend={key:key,name:typeExtendName},newTypeExtendKV=[];for(let j=0;j<itemValues.length;j++){var name=itemValues[j],value="sort"===key?j+"":"全部"===name?"0":name;newTypeExtendKV.push({n:name,v:value})}newTypeExtend.init="sort"===key?"1":newTypeExtendKV[0].v,newTypeExtend.value=newTypeExtendKV,filterAll.push(newTypeExtend)}}_.isEmpty(filterAll)||(filterObj[typeId]=filterAll)}catch(e){console.log(e)}}}return JSON.stringify({class:classes,filters:filterObj})}async function homeVod(){var videos=[];for(const item of JSON.parse(await request(url+"/api.php/Index/getHomePage",{type:1,p:1})).data.video)if(0===item.title.styleType)for(const vObj of item.list)videos.push({vod_id:vObj.vod_id,vod_name:vObj.vod_name,vod_pic:vObj.vod_pic,vod_remarks:vObj.vod_remarks||vObj.vod_score||""});return JSON.stringify({list:videos})}async function category(tid,pg,filter,extend){0==pg&&(pg=1);var reqUrl=url+"/api.php/Video/getFilterVideoList",extend=JSON.parse(jinja2(`{
|
||||||
|
|
||||||
let key = 'kkys';
|
|
||||||
let url = 'https://api1.baibaipei.com:8899';
|
|
||||||
let device = {};
|
|
||||||
let siteKey = '';
|
|
||||||
let siteType = 0;
|
|
||||||
|
|
||||||
async function request(reqUrl, postData, agentSp, get) {
|
|
||||||
let ts = dayjs().valueOf().toString();
|
|
||||||
let rand = randStr(32);
|
|
||||||
let sign = Crypto.MD5('abcdexxxdd2daklmn25129_' + ts + '_' + rand)
|
|
||||||
.toString()
|
|
||||||
.toLowerCase();
|
|
||||||
let headers = {
|
|
||||||
'user-agent': agentSp || device.ua,
|
|
||||||
};
|
|
||||||
if (reqUrl.includes('baibaipei')) {
|
|
||||||
headers['device-id'] = device.id;
|
|
||||||
headers['push-token'] = '';
|
|
||||||
headers['sign'] = sign;
|
|
||||||
headers['time'] = ts;
|
|
||||||
headers['md5'] = rand;
|
|
||||||
headers['version'] = '2.1.0';
|
|
||||||
headers['system-model'] = device.model;
|
|
||||||
headers['system-brand'] = device.brand;
|
|
||||||
headers['system-version'] = device.release;
|
|
||||||
}
|
|
||||||
let res = await req(reqUrl, {
|
|
||||||
method: get ? 'get' : 'post',
|
|
||||||
headers: headers,
|
|
||||||
data: postData || {},
|
|
||||||
postType: get ? '' : 'form',
|
|
||||||
});
|
|
||||||
|
|
||||||
let content = res.content;
|
|
||||||
// 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(33).toLowerCase();
|
|
||||||
device.ua = 'okhttp/4.1.0';
|
|
||||||
await local.set(key, deviceKey, JSON.stringify(device));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function home(filter) {
|
|
||||||
// await req('https://www.facebook.com', {});
|
|
||||||
let data = JSON.parse(await request(url + '/api.php/Index/getTopVideoCategory')).data;
|
|
||||||
let classes = [];
|
|
||||||
let filterObj = {};
|
|
||||||
for (const type of data) {
|
|
||||||
let typeName = type.nav_name;
|
|
||||||
if (typeName == '推荐') continue;
|
|
||||||
let typeId = type.nav_type_id.toString();
|
|
||||||
classes.push({
|
|
||||||
type_id: typeId,
|
|
||||||
type_name: typeName,
|
|
||||||
});
|
|
||||||
if (!filter) continue;
|
|
||||||
try {
|
|
||||||
let filterAll = [];
|
|
||||||
let filterData = JSON.parse(await request(url + '/api.php/Video/getFilterType', { type: typeId })).data;
|
|
||||||
for (let key of Object.keys(filterData)) {
|
|
||||||
let itemValues = filterData[key];
|
|
||||||
if (key === 'plot') key = 'class';
|
|
||||||
let typeExtendName = '';
|
|
||||||
switch (key) {
|
|
||||||
case 'class':
|
|
||||||
typeExtendName = '类型';
|
|
||||||
break;
|
|
||||||
case 'area':
|
|
||||||
typeExtendName = '地区';
|
|
||||||
break;
|
|
||||||
case 'lang':
|
|
||||||
typeExtendName = '语言';
|
|
||||||
break;
|
|
||||||
case 'year':
|
|
||||||
typeExtendName = '年代';
|
|
||||||
break;
|
|
||||||
case 'sort':
|
|
||||||
typeExtendName = '排序';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (typeExtendName.length === 0) continue;
|
|
||||||
let newTypeExtend = {
|
|
||||||
key: key,
|
|
||||||
name: typeExtendName,
|
|
||||||
};
|
|
||||||
let newTypeExtendKV = [];
|
|
||||||
for (let j = 0; j < itemValues.length; j++) {
|
|
||||||
const name = itemValues[j];
|
|
||||||
let value = key === 'sort' ? j + '' : name === '全部' ? '0' : name;
|
|
||||||
newTypeExtendKV.push({ n: name, v: value });
|
|
||||||
}
|
|
||||||
newTypeExtend['init'] = key === 'sort' ? '1' : newTypeExtendKV[0]['v'];
|
|
||||||
newTypeExtend.value = newTypeExtendKV;
|
|
||||||
filterAll.push(newTypeExtend);
|
|
||||||
}
|
|
||||||
if (!_.isEmpty(filterAll)) {
|
|
||||||
filterObj[typeId] = filterAll;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// console.log(await homeVod());
|
|
||||||
// console.log(classes);
|
|
||||||
// console.log(filterObj);
|
|
||||||
return JSON.stringify({
|
|
||||||
class: classes,
|
|
||||||
filters: filterObj,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function homeVod() {
|
|
||||||
let jsonArray = JSON.parse(await request(url + '/api.php/Index/getHomePage', { type: 1, p: 1 })).data.video;
|
|
||||||
let videos = [];
|
|
||||||
for (const item of jsonArray) {
|
|
||||||
if (item.title.styleType !== 0) continue;
|
|
||||||
for (const vObj of item.list) {
|
|
||||||
videos.push({
|
|
||||||
vod_id: vObj.vod_id,
|
|
||||||
vod_name: vObj.vod_name,
|
|
||||||
vod_pic: vObj.vod_pic,
|
|
||||||
vod_remarks: vObj.vod_remarks || vObj.vod_score || '',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return JSON.stringify({
|
|
||||||
list: videos,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function category(tid, pg, filter, extend) {
|
|
||||||
if (pg == 0) pg = 1;
|
|
||||||
let reqUrl = url + '/api.php/Video/getFilterVideoList';
|
|
||||||
var formData = JSON.parse(
|
|
||||||
jinja2(
|
|
||||||
`{
|
|
||||||
"type": "{{tid}}",
|
"type": "{{tid}}",
|
||||||
"p": "{{pg}}",
|
"p": "{{pg}}",
|
||||||
"area": "{{ext.area|default(0)}}",
|
"area": "{{ext.area|default(0)}}",
|
||||||
"year": "{{ext.year|default(0)}}",
|
"year": "{{ext.year|default(0)}}",
|
||||||
"sort": "{{ext.sort|default(0)}}",
|
"sort": "{{ext.sort|default(0)}}",
|
||||||
"class": "{{ext.class|default(0)}}"
|
"class": "{{ext.class|default(0)}}"
|
||||||
}`,
|
}`,{ext:extend,tid:tid,pg:pg})),tid=(console.log(extend),JSON.parse(await request(reqUrl,extend)).data),videos=[];for(const vod of tid.data)videos.push({vod_id:vod.vod_id,vod_name:vod.vod_name,vod_pic:vod.vod_pic,vod_remarks:vod.vod_remarks||vod.vod_score||""});return JSON.stringify({page:parseInt(tid.current_page),pagecount:parseInt(tid.last_page),limit:parseInt(tid.per_page),total:parseInt(tid.total),list:videos})}async function detail(id){var id=JSON.parse(await request(url+"/api.php/Video/getVideoInfo",{video_id:id})).data.video,vod={vod_id:id.vod_id,vod_name:id.vod_name,vod_pic:id.vod_pic,type_name:id.vod_class,vod_year:id.vod_year,vod_area:id.vod_area,vod_remarks:id.vod_remarks||"",vod_actor:id.vod_actor,vod_director:id.vod_director,vod_content:id.vod_content.trim()},playlist={};for(const item of id.vod_play){var from=item.playerForm;if("jp"!==from&&"xg"!==from){let urls=[];for(const u of item.url)urls.push(formatPlayUrl(vod.vod_name,u.title)+"$"+u.play_url);!playlist.hasOwnProperty(from)&&0<urls.length&&(playlist[from]=urls)}}parse=id.parse||[],vod.vod_play_from=_.keys(playlist).join("$$$");var vod_play_url=[];for(const urlist of _.values(playlist))vod_play_url.push(urlist.join("#"));return vod.vod_play_url=vod_play_url.join("$$$"),JSON.stringify({list:[vod]})}var parse=[];async function play(flag,id,flags){try{if((0<=id.indexOf("youku")||0<=id.indexOf("iqiyi")||0<=id.indexOf("v.qq.com")||0<=id.indexOf("pptv")||0<=id.indexOf("le.com")||0<=id.indexOf("1905.com")||0<=id.indexOf("mgtv"))&&0<parse.length)for(let index=0;index<parse.length;index++)try{var p=parse[index];let res=await req(p+id,{headers:{"user-agent":"okhttp/4.1.0"}});if((result=jsonParse(id,JSON.parse(res.content))).url)return result.parse=0,JSON.stringify(result)}catch(error){}if(0<=id.indexOf("jqq-")){var jqqHeader=await request(url+"/jqqheader.json",null,null,!0),jqqHeaders=JSON.parse(jqqHeader),ids=id.split("-"),jxJqq=await req("https://api.juquanquanapp.com/app/drama/detail?dramaId="+ids[1]+"&episodeSid="+ids[2]+"&quality=LD",{headers:jqqHeaders}),jqqInfo=JSON.parse(jxJqq.content);if(jqqInfo.data.playInfo.url)return JSON.stringify({parse:0,playUrl:"",url:jqqInfo.data.playInfo.url})}var result,res=await request(url+"/video.php",{url:id});return(result=jsonParse(id,JSON.parse(res).data)).url?(result.parse=0,JSON.stringify(result)):JSON.stringify({parse:0,playUrl:"",url:id})}catch(e){return console.log(e),JSON.stringify({parse:0,url:id})}}async function search(wd,quick){var videos=[];for(const vod of JSON.parse(await request(url+"/api.php/Search/getSearch",{key:wd,type_id:0,p:1})).data.data)videos.push({vod_id:vod.vod_id,vod_name:vod.vod_name,vod_pic:vod.vod_pic,vod_remarks:vod.vod_remarks||vod.vod_score||""});return JSON.stringify({list:videos})}const charStr="abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789";function randStr(len,withNum){for(var _str="",containsNum=void 0===withNum||withNum,i=0;i<len;i++){var 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,!1).toUpperCase()+_.random(11,99)+randStr(1,!1).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=url.startsWith("//")?"https:"+url:url).startsWith("http"))return{};let headers=json.headers||{};var ua=(json["user-agent"]||"").trim(),referer=(0<ua.length&&(headers["User-Agent"]=ua),(json.referer||"").trim());return 0<referer.length&&(headers.Referer=referer),_.keys(headers).forEach(hk=>{headers[hk]||delete headers[hk]}),{header:headers,url:url}}catch(error){console.log(error)}return{}}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};
|
||||||
{ ext: extend, tid: tid, pg: pg }
|
|
||||||
)
|
|
||||||
);
|
|
||||||
console.log(formData);
|
|
||||||
let data = JSON.parse(await request(reqUrl, formData)).data;
|
|
||||||
let videos = [];
|
|
||||||
for (const vod of data.data) {
|
|
||||||
videos.push({
|
|
||||||
vod_id: vod.vod_id,
|
|
||||||
vod_name: vod.vod_name,
|
|
||||||
vod_pic: vod.vod_pic,
|
|
||||||
vod_remarks: vod.vod_remarks || vod.vod_score || '',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return JSON.stringify({
|
|
||||||
page: parseInt(data.current_page),
|
|
||||||
pagecount: parseInt(data.last_page),
|
|
||||||
limit: parseInt(data.per_page),
|
|
||||||
total: parseInt(data.total),
|
|
||||||
list: videos,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function detail(id) {
|
|
||||||
let data = JSON.parse(await request(url + '/api.php/Video/getVideoInfo', { video_id: id })).data.video;
|
|
||||||
let vod = {
|
|
||||||
vod_id: data.vod_id,
|
|
||||||
vod_name: data.vod_name,
|
|
||||||
vod_pic: data.vod_pic,
|
|
||||||
type_name: data.vod_class,
|
|
||||||
vod_year: data.vod_year,
|
|
||||||
vod_area: data.vod_area,
|
|
||||||
vod_remarks: data.vod_remarks || '',
|
|
||||||
vod_actor: data.vod_actor,
|
|
||||||
vod_director: data.vod_director,
|
|
||||||
vod_content: data.vod_content.trim(),
|
|
||||||
};
|
|
||||||
let playlist = {};
|
|
||||||
for (const item of data.vod_play) {
|
|
||||||
let from = item.playerForm;
|
|
||||||
if (from === 'jp') continue;
|
|
||||||
if (from === 'xg') continue;
|
|
||||||
let urls = [];
|
|
||||||
for (const u of item.url) {
|
|
||||||
urls.push(formatPlayUrl(vod.vod_name, u.title) + '$' + u.play_url);
|
|
||||||
}
|
|
||||||
if (!playlist.hasOwnProperty(from) && urls.length > 0) {
|
|
||||||
playlist[from] = urls;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parse = data.parse || [];
|
|
||||||
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],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var parse = [];
|
|
||||||
|
|
||||||
async function play(flag, id, flags) {
|
|
||||||
try {
|
|
||||||
if (id.indexOf('youku') >= 0 || id.indexOf('iqiyi') >= 0 || id.indexOf('v.qq.com') >= 0 || id.indexOf('pptv') >= 0 || id.indexOf('le.com') >= 0 || id.indexOf('1905.com') >= 0 || id.indexOf('mgtv') >= 0) {
|
|
||||||
if (parse.length > 0) {
|
|
||||||
for (let index = 0; index < parse.length; index++) {
|
|
||||||
try {
|
|
||||||
const p = parse[index];
|
|
||||||
let res = await req(p + id, {
|
|
||||||
headers: { 'user-agent': 'okhttp/4.1.0' },
|
|
||||||
});
|
|
||||||
var result = jsonParse(id, JSON.parse(res.content));
|
|
||||||
if (result.url) {
|
|
||||||
result.parse = 0;
|
|
||||||
return JSON.stringify(result);
|
|
||||||
}
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (id.indexOf('jqq-') >= 0) {
|
|
||||||
var jqqHeader = await request(url + '/jqqheader.json', null, null, true);
|
|
||||||
var jqqHeaders = JSON.parse(jqqHeader);
|
|
||||||
var ids = id.split('-');
|
|
||||||
var jxJqq = await req('https://api.juquanquanapp.com/app/drama/detail?dramaId=' + ids[1] + '&episodeSid=' + ids[2] + '&quality=LD', { headers: jqqHeaders });
|
|
||||||
var jqqInfo = JSON.parse(jxJqq.content);
|
|
||||||
if (jqqInfo.data.playInfo.url) {
|
|
||||||
return JSON.stringify({
|
|
||||||
parse: 0,
|
|
||||||
playUrl: '',
|
|
||||||
url: jqqInfo.data.playInfo.url,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let res = await request(url + '/video.php', { url: id });
|
|
||||||
var result = jsonParse(id, JSON.parse(res).data);
|
|
||||||
if (result.url) {
|
|
||||||
result.parse = 0;
|
|
||||||
// demo of block hls ads
|
|
||||||
if (/vip\.lz|hd\.lz/.test(result.url)) {
|
|
||||||
result.url = await js2Proxy(true, siteType, siteKey, 'lzm3u8/' + base64Encode(result.url), {});
|
|
||||||
}
|
|
||||||
return JSON.stringify(result);
|
|
||||||
}
|
|
||||||
return JSON.stringify({
|
|
||||||
parse: 0,
|
|
||||||
playUrl: '',
|
|
||||||
url: id,
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
return JSON.stringify({
|
|
||||||
parse: 0,
|
|
||||||
url: id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function proxy(segments, headers) {
|
|
||||||
let what = segments[0];
|
|
||||||
let url = base64Decode(segments[1]);
|
|
||||||
if (what == 'lzm3u8') {
|
|
||||||
const resp = await req(url, {});
|
|
||||||
let hls = resp.content;
|
|
||||||
const jsBase = await js2Proxy(false, siteType, siteKey, 'lzm3u8/', {});
|
|
||||||
const baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
|
|
||||||
console.log(hls.length);
|
|
||||||
hls = hls.replace(/#EXT-X-DISCONTINUITY\r*\n*#EXTINF:6.433333,[\s\S]*?#EXT-X-DISCONTINUITY/, '');
|
|
||||||
console.log(hls.length);
|
|
||||||
hls = hls.replace(/(#EXT-X-KEY\S+URI=")(\S+)("\S+)/g, function (match, p1, p2, p3) {
|
|
||||||
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
|
||||||
return p1 + up + p3;
|
|
||||||
});
|
|
||||||
hls = hls.replace(/(#EXT-X-STREAM-INF:.*\n)(.*)/g, function (match, p1, p2) {
|
|
||||||
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
|
||||||
return p1 + jsBase + base64Encode(up);
|
|
||||||
});
|
|
||||||
hls = hls.replace(/(#EXTINF:.*\n)(.*)/g, function (match, p1, p2) {
|
|
||||||
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
|
||||||
return p1 + up;
|
|
||||||
});
|
|
||||||
return JSON.stringify({
|
|
||||||
code: resp.code,
|
|
||||||
content: hls,
|
|
||||||
headers: resp.headers,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return JSON.stringify({
|
|
||||||
code: 500,
|
|
||||||
content: '',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function search(wd, quick) {
|
|
||||||
let data = JSON.parse(await request(url + '/api.php/Search/getSearch', { key: wd, type_id: 0, p: 1 })).data;
|
|
||||||
let videos = [];
|
|
||||||
for (const vod of data.data) {
|
|
||||||
videos.push({
|
|
||||||
vod_id: vod.vod_id,
|
|
||||||
vod_name: vod.vod_name,
|
|
||||||
vod_pic: vod.vod_pic,
|
|
||||||
vod_remarks: vod.vod_remarks || vod.vod_score || '',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return JSON.stringify({
|
|
||||||
list: 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));
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
_.keys(headers).forEach((hk) => {
|
|
||||||
if (!headers[hk]) delete headers[hk];
|
|
||||||
});
|
|
||||||
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,
|
|
||||||
proxy: proxy,
|
|
||||||
search: search,
|
|
||||||
};
|
|
||||||
}
|
|
@ -2,7 +2,7 @@
|
|||||||
import { load, _ } from './lib/cat.js';
|
import { load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
var key = 'libvio';
|
var key = 'libvio';
|
||||||
var HOST = 'https://www.libvio.pro'; // 地址发布页
|
var HOST = 'https://libvio.app'; // 地址发布页
|
||||||
var host = '';
|
var host = '';
|
||||||
var siteKey = '';
|
var siteKey = '';
|
||||||
var siteType = 0;
|
var siteType = 0;
|
||||||
|
171
cat/wobg_open.js
Normal file
171
cat/wobg_open.js
Normal 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,
|
||||||
|
};
|
||||||
|
}
|
156
cat/wogg_open.js
156
cat/wogg_open.js
File diff suppressed because one or more lines are too long
1
cat/ysc_open.js
Normal file
1
cat/ysc_open.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user