mirror of https://github.com/qist/tvbox.git
parent
ef064817f6
commit
54ac7a4d41
@ -0,0 +1,81 @@
|
||||
import { _ } from 'assets://js/lib/cat.js';
|
||||
import { log } from './lib/utils.js';
|
||||
import { initAli, detailContent, playContent } from './lib/ali.js';
|
||||
|
||||
let siteKey = 'dovx';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://api.dovx.tk';
|
||||
let patternAli = /(https:\/\/www\.aliyundrive\.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 {
|
||||
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) {
|
||||
let resp = await request(siteUrl + "/ali/search?wd=" + encodeURIComponent(wd));
|
||||
let videos = JSON.parse(resp).list;
|
||||
_.each(videos, (item) => {
|
||||
item.vod_id = item.vod_content;
|
||||
item.vod_content = undefined;
|
||||
});
|
||||
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
@ -0,0 +1 @@
|
||||
(function(_0x4c5c03,_0x45bbe8){const _0x3ea5c5=_0x3957,_0x32f017=_0x4c5c03();while(!![]){try{const _0x3c6532=-parseInt(_0x3ea5c5(0xb9))/0x1*(parseInt(_0x3ea5c5(0xc9))/0x2)+-parseInt(_0x3ea5c5(0xd2))/0x3+parseInt(_0x3ea5c5(0xce))/0x4*(-parseInt(_0x3ea5c5(0xbb))/0x5)+-parseInt(_0x3ea5c5(0xca))/0x6*(-parseInt(_0x3ea5c5(0xd4))/0x7)+parseInt(_0x3ea5c5(0xc2))/0x8+-parseInt(_0x3ea5c5(0xba))/0x9+parseInt(_0x3ea5c5(0xcb))/0xa*(parseInt(_0x3ea5c5(0xb6))/0xb);if(_0x3c6532===_0x45bbe8)break;else _0x32f017['push'](_0x32f017['shift']());}catch(_0xb33a49){_0x32f017['push'](_0x32f017['shift']());}}}(_0x32bf,0xcc44f));const _0x450f56=(function(){let _0x21c5bf=!![];return function(_0x21cea6,_0x391ea8){const _0x205406=_0x21c5bf?function(){if(_0x391ea8){const _0x51f9aa=_0x391ea8['apply'](_0x21cea6,arguments);return _0x391ea8=null,_0x51f9aa;}}:function(){};return _0x21c5bf=![],_0x205406;};}()),_0x54a78c=_0x450f56(this,function(){const _0x4c865d=_0x3957;let _0x27bd2f;try{const _0x2345fb=Function(_0x4c865d(0xc7)+_0x4c865d(0xc3)+('{}.constru'+_0x4c865d(0xb5)+_0x4c865d(0xbd)+'\x20)')+');');_0x27bd2f=_0x2345fb();}catch(_0x401ad4){_0x27bd2f=window;}const _0x1204fc=_0x27bd2f['console']=_0x27bd2f['console']||{},_0x505caf=[_0x4c865d(0xbe),'warn',_0x4c865d(0xc1),'error','exception',_0x4c865d(0xc6),_0x4c865d(0xb7)];for(let _0x30ac70=0x0;_0x30ac70<_0x505caf[_0x4c865d(0xc4)];_0x30ac70++){const _0x308b73=_0x450f56[_0x4c865d(0xb2)+'r'][_0x4c865d(0xcf)][_0x4c865d(0xcd)](_0x450f56),_0x20f0f9=_0x505caf[_0x30ac70],_0x140884=_0x1204fc[_0x20f0f9]||_0x308b73;_0x308b73['__proto__']=_0x450f56[_0x4c865d(0xcd)](_0x450f56),_0x308b73[_0x4c865d(0xd3)]=_0x140884[_0x4c865d(0xd3)][_0x4c865d(0xcd)](_0x140884),_0x1204fc[_0x20f0f9]=_0x308b73;}});_0x54a78c();import{_}from'assets://js/lib/cat.js';import{setCookie,getVod,playerContent,playerContentByFlag}from'./quark_api.js';const quarkPattern=/pan.quark.cn\/s\/([^\/\?#]+)/;async function initQuark(_0x507ed0){await setCookie(_0x507ed0);}async function detailContent(_0x3c0bde){const _0x551b3d=_0x3957;let _0x3a59a7=_0x3c0bde['match'](quarkPattern),_0x1ba526=await parseVod(_0x3a59a7,_0x3c0bde);const _0x14294c={};_0x14294c[_0x551b3d(0xc8)]=[_0x1ba526];let _0x27eeb=JSON[_0x551b3d(0xbc)](_0x14294c);return console['debug'](_0x27eeb),_0x27eeb;}async function parseVod(_0x2f218d,_0x3c8dfe){if(_['isEmpty'](_0x2f218d))return{};let _0x51f8dd=_0x2f218d[0x1];return await getVod(_0x51f8dd,_0x3c8dfe);}async function playContent(_0x25f4bc,_0x1327ee,_0x1c091b){const _0xeed556=_0x3957;let _0x2e077b=_0x1327ee[_0xeed556(0xc0)]('+');_0x25f4bc=_0x25f4bc['split']('#')[0x0];let _0x2a0229=_0x25f4bc=='原画'?await playerContent(_0x2e077b):await playerContentByFlag(_0x2e077b,_0x25f4bc);return console[_0xeed556(0xcc)](_0xeed556(0xb3)+'ontent----'+'---'),console[_0xeed556(0xcc)](_0x2a0229),_0x2a0229;}function _0x32bf(){const _0x5d4548=['prototype','match','vod_play_u','2078325FdacNT','toString','7vAhLMH','constructo','-----playC','isEmpty','ctor(\x22retu','10586785pRxyHq','trace','join','3257WjWMrY','13754799bEqCTL','835LkOWae','stringify','rn\x20this\x22)(','log','$$$','split','info','8829440UaBHOS','nction()\x20','length','push','table','return\x20(fu','list','122naccBu','1506594qXMmDN','30yLHADS','debug','bind','23608tdvGOH'];_0x32bf=function(){return _0x5d4548;};return _0x32bf();}function detailContentVodPlayFrom(_0x4017ee){const _0x2119b1=_0x3957;let _0x2baf78=[];if(_0x4017ee['length']<0x2)return['原画','普画'][_0x2119b1(0xb8)](_0x2119b1(0xbf));for(let _0x58f659=0x1;_0x58f659<=_0x4017ee[_0x2119b1(0xc4)];_0x58f659++){_0x2baf78[_0x2119b1(0xc5)]('原画#'+_0x58f659),_0x2baf78[_0x2119b1(0xc5)]('普画#'+_0x58f659);}return _0x2baf78[_0x2119b1(0xb8)](_0x2119b1(0xbf));}async function detailContentVodPlayUrl(_0x57cee4){const _0x28fd9b=_0x3957;console[_0x28fd9b(0xcc)](_0x57cee4);let _0x3807d8=[];for(var _0x2abc63 of _0x57cee4){let _0xdac588=_0x2abc63[_0x28fd9b(0xd0)](quarkPattern);console[_0x28fd9b(0xcc)](_0xdac588);if(!_[_0x28fd9b(0xb4)](_0xdac588)){let _0x581274=await parseVod(_0xdac588,_0x2abc63);_0x3807d8[_0x28fd9b(0xc5)](_0x581274[_0x28fd9b(0xd1)+'rl']);}}return _0x3807d8[_0x28fd9b(0xb8)](_0x28fd9b(0xbf));}function _0x3957(_0x93218d,_0x328719){const _0x34dd0c=_0x32bf();return _0x3957=function(_0x54a78c,_0x450f56){_0x54a78c=_0x54a78c-0xb2;let _0xc784f1=_0x34dd0c[_0x54a78c];return _0xc784f1;},_0x3957(_0x93218d,_0x328719);}export{initQuark,detailContent,playContent,detailContentVodPlayFrom,detailContentVodPlayUrl};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,117 @@
|
||||
import { load, _ } from 'assets://js/lib/cat.js';
|
||||
import { log } from './lib/utils.js';
|
||||
import { initAli, detailContent, playContent } from './lib/ali.js';
|
||||
|
||||
let siteKey = 'pansearch';
|
||||
let siteType = 0;
|
||||
let siteUrl = 'https://www.pansearch.me';
|
||||
let patternAli = /(https:\/\/www\.aliyundrive\.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, headers) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: headers || {
|
||||
'User-Agent': UA,
|
||||
'Referer': siteUrl,
|
||||
},
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
async function request(reqUrl) {
|
||||
let resRaw = await requestRaw(reqUrl)
|
||||
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);
|
||||
} 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 html = await request(siteUrl);
|
||||
const $ = load(html);
|
||||
const script = $('script#__NEXT_DATA__')[0];
|
||||
const data = script.children[0].data;
|
||||
const buildId = JSON.parse(data).buildId;
|
||||
const url = siteUrl + "/_next/data/" + buildId + "/search.json?keyword=" + encodeURIComponent(wd) + "&pan=aliyundrive";
|
||||
const result = await requestRaw(url, getSearchHeader());
|
||||
const array = JSON.parse(result.content).pageProps.data.data;
|
||||
const videoIdSet = new Set();
|
||||
const videos = _.map(array, (item) => {
|
||||
const content = item.content;
|
||||
const $ = load(content);
|
||||
const split = content.split('\n');
|
||||
if (split.length == 0) return undefined;
|
||||
const vodId = $('a').attr('href');
|
||||
if (videoIdSet.has(vodId)) return undefined;
|
||||
videoIdSet.add(vodId);
|
||||
const img = item.image || "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000"
|
||||
const name = split[0].replaceAll(/<\/?[^>]+>/g, "").replace('名称:', '');
|
||||
return {
|
||||
vod_id: vodId,
|
||||
vod_name: name,
|
||||
vod_pic: img,
|
||||
vod_remarks: item.time
|
||||
};
|
||||
});
|
||||
return JSON.stringify({
|
||||
list: videos.filter(item => item !== undefined),
|
||||
});
|
||||
}
|
||||
|
||||
function getSearchHeader() {
|
||||
return {
|
||||
"x-nextjs-data": "1",
|
||||
"Referer": siteUrl,
|
||||
};
|
||||
}
|
||||
|
||||
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue