Add files via upload
This commit is contained in:
parent
0d6e0973df
commit
383cb02356
@ -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 {
|
let preMatches = id.match(patternAli);
|
||||||
await log('detail:id:---' + id);
|
if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]);
|
||||||
let preMatches = id.match(patternAli);
|
let url = siteUrl + id;
|
||||||
if (!_.isEmpty(preMatches)) return await detailContent(preMatches[1]);
|
let aliUrl = await getString(url);
|
||||||
let url = siteUrl + id;
|
let matches = aliUrl.match(patternAli);
|
||||||
let aliUrl = await getString(url);
|
if (!_.isEmpty(matches)) return await detailContent(matches[1]);
|
||||||
let matches = aliUrl.match(patternAli);
|
return '';
|
||||||
console.log('detailmatche---');
|
|
||||||
console.log(matches[1]);
|
|
||||||
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) {
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user