Add files via upload

This commit is contained in:
n3rddd 2023-08-05 17:31:14 +08:00 committed by GitHub
parent 0d6e0973df
commit 383cb02356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,20 +2,23 @@ import {load, _, Uri} from './lib/cat.js';
import {log} from './lib/utils.js'; import {log} from './lib/utils.js';
import {initAli, detailContent, playContent} from './lib/ali.js'; import {initAli, detailContent, playContent} from './lib/ali.js';
let siteKey = 'wogg'; let siteKey = '';
let siteType = 0; let siteType = 0;
let siteUrl = 'https://wogg.xyz'; let siteUrl = 'https://wogg.xyz';
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 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\.com\/s\/[^"]+)/ let patternAli = /(https:\/\/www\.aliyundrive\.com\/s\/[^"]+)/
// cfg = {skey: siteKey, ext: extend}
async function init(cfg) { async function init(cfg) {
try { let ext = '';
siteKey = _.isEmpty(cfg.skey) ? '' : cfg.skey; if (typeof cfg == 'object') {
siteType = _.isEmpty(cfg.stype) ? '' : cfg.stype; siteKey = cfg.skey;
await initAli(cfg); siteType = cfg.stype;
} catch (e) { ext = cfg.ext;
await log('init:' + e.message + ' line:' + e.lineNumber); } else {
ext = cfg; //适配影视
} }
await initAli(ext);
} }
async function request(reqUrl, agentSp) { async function request(reqUrl, agentSp) {
@ -92,29 +95,18 @@ async function category(tid, pg, filter, extend) {
} }
async function detail(id) { async function detail(id) {
try {
await log('detail:id:---' + id);
let preMatches = id.match(patternAli); let preMatches = id.match(patternAli);
if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]); if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]);
let url = siteUrl + id; let url = siteUrl + id;
let aliUrl = await getString(url); let aliUrl = await getString(url);
let matches = aliUrl.match(patternAli); let matches = aliUrl.match(patternAli);
console.log('detailmatche---');
console.log(matches[1]);
if (!_.isEmpty(matches)) return await detailContent(matches[1]); if (!_.isEmpty(matches)) return await detailContent(matches[1]);
return ''; return '';
} catch (e) {
await log( 'detail:' + e.message + ' line:' + e.lineNumber);
}
} }
async function play(flag, id, flags) { async function play(flag, id, flags) {
try {
return await playContent(flag, id, flags); return await playContent(flag, id, flags);
} catch (e) {
await log( 'play:' + e.message + ' line:' + e.lineNumber);
}
} }