Add files via upload
This commit is contained in:
parent
93b6c45746
commit
514b342d02
566
JS/cheerio.min.js
vendored
566
JS/cheerio.min.js
vendored
File diff suppressed because one or more lines are too long
6074
JS/crypto-hiker.js
Normal file
6074
JS/crypto-hiker.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -70,8 +70,7 @@
|
|||||||
// Use randomBytes method (NodeJS)
|
// Use randomBytes method (NodeJS)
|
||||||
if (typeof crypto.randomBytes === 'function') {
|
if (typeof crypto.randomBytes === 'function') {
|
||||||
try {
|
try {
|
||||||
return crypto.randomBytes(4)
|
return crypto.randomBytes(4).readInt32LE();
|
||||||
.readInt32LE();
|
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,8 +272,7 @@
|
|||||||
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
||||||
*/
|
*/
|
||||||
toString: function(encoder) {
|
toString: function(encoder) {
|
||||||
return (encoder || Hex)
|
return (encoder || Hex).stringify(this);
|
||||||
.stringify(this);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -405,10 +403,8 @@
|
|||||||
var hexChars = [];
|
var hexChars = [];
|
||||||
for (var i = 0; i < sigBytes; i++) {
|
for (var i = 0; i < sigBytes; i++) {
|
||||||
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||||
hexChars.push((bite >>> 4)
|
hexChars.push((bite >>> 4).toString(16));
|
||||||
.toString(16));
|
hexChars.push((bite & 0x0f).toString(16));
|
||||||
hexChars.push((bite & 0x0f)
|
|
||||||
.toString(16));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return hexChars.join('');
|
return hexChars.join('');
|
||||||
@ -770,8 +766,7 @@
|
|||||||
*/
|
*/
|
||||||
_createHelper: function(hasher) {
|
_createHelper: function(hasher) {
|
||||||
return function(message, cfg) {
|
return function(message, cfg) {
|
||||||
return new hasher.init(cfg)
|
return new hasher.init(cfg).finalize(message);
|
||||||
.finalize(message);
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -790,8 +785,7 @@
|
|||||||
*/
|
*/
|
||||||
_createHmacHelper: function(hasher) {
|
_createHmacHelper: function(hasher) {
|
||||||
return function(message, key) {
|
return function(message, key) {
|
||||||
return new C_algo.HMAC.init(hasher, key)
|
return new C_algo.HMAC.init(hasher, key).finalize(message);
|
||||||
.finalize(message);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -3160,8 +3154,7 @@
|
|||||||
// Compute HMAC
|
// Compute HMAC
|
||||||
var innerHash = hasher.finalize(messageUpdate);
|
var innerHash = hasher.finalize(messageUpdate);
|
||||||
hasher.reset();
|
hasher.reset();
|
||||||
var hmac = hasher.finalize(this._oKey.clone()
|
var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
|
||||||
.concat(innerHash));
|
|
||||||
|
|
||||||
return hmac;
|
return hmac;
|
||||||
}
|
}
|
||||||
@ -3242,8 +3235,7 @@
|
|||||||
|
|
||||||
// Generate key
|
// Generate key
|
||||||
while (derivedKeyWords.length < keySize) {
|
while (derivedKeyWords.length < keySize) {
|
||||||
var block = hmac.update(salt)
|
var block = hmac.update(salt).finalize(blockIndex);
|
||||||
.finalize(blockIndex);
|
|
||||||
hmac.reset();
|
hmac.reset();
|
||||||
|
|
||||||
// Shortcuts
|
// Shortcuts
|
||||||
@ -3292,8 +3284,7 @@
|
|||||||
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
|
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
|
||||||
*/
|
*/
|
||||||
C.PBKDF2 = function(password, salt, cfg) {
|
C.PBKDF2 = function(password, salt, cfg) {
|
||||||
return PBKDF2.create(cfg)
|
return PBKDF2.create(cfg).compute(password, salt);
|
||||||
.compute(password, salt);
|
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@ -3374,8 +3365,7 @@
|
|||||||
if (block) {
|
if (block) {
|
||||||
hasher.update(block);
|
hasher.update(block);
|
||||||
}
|
}
|
||||||
block = hasher.update(password)
|
block = hasher.update(password).finalize(salt);
|
||||||
.finalize(salt);
|
|
||||||
hasher.reset();
|
hasher.reset();
|
||||||
|
|
||||||
// Iterations
|
// Iterations
|
||||||
@ -3410,8 +3400,7 @@
|
|||||||
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
|
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
|
||||||
*/
|
*/
|
||||||
C.EvpKDF = function(password, salt, cfg) {
|
C.EvpKDF = function(password, salt, cfg) {
|
||||||
return EvpKDF.create(cfg)
|
return EvpKDF.create(cfg).compute(password, salt);
|
||||||
.compute(password, salt);
|
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@ -3601,13 +3590,11 @@
|
|||||||
return function(cipher) {
|
return function(cipher) {
|
||||||
return {
|
return {
|
||||||
encrypt: function(message, key, cfg) {
|
encrypt: function(message, key, cfg) {
|
||||||
return selectCipherStrategy(key)
|
return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
|
||||||
.encrypt(cipher, message, key, cfg);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
decrypt: function(ciphertext, key, cfg) {
|
decrypt: function(ciphertext, key, cfg) {
|
||||||
return selectCipherStrategy(key)
|
return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
|
||||||
.decrypt(cipher, ciphertext, key, cfg);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -3971,8 +3958,7 @@
|
|||||||
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
||||||
*/
|
*/
|
||||||
toString: function(formatter) {
|
toString: function(formatter) {
|
||||||
return (formatter || this.formatter)
|
return (formatter || this.formatter).stringify(this);
|
||||||
.stringify(this);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4007,9 +3993,7 @@
|
|||||||
|
|
||||||
// Format
|
// Format
|
||||||
if (salt) {
|
if (salt) {
|
||||||
wordArray = WordArray.create([0x53616c74, 0x65645f5f])
|
wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
|
||||||
.concat(salt)
|
|
||||||
.concat(ciphertext);
|
|
||||||
} else {
|
} else {
|
||||||
wordArray = ciphertext;
|
wordArray = ciphertext;
|
||||||
}
|
}
|
||||||
@ -4136,8 +4120,7 @@
|
|||||||
ciphertext = this._parse(ciphertext, cfg.format);
|
ciphertext = this._parse(ciphertext, cfg.format);
|
||||||
|
|
||||||
// Decrypt
|
// Decrypt
|
||||||
var plaintext = cipher.createDecryptor(key, cfg)
|
var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
|
||||||
.finalize(ciphertext.ciphertext);
|
|
||||||
|
|
||||||
return plaintext;
|
return plaintext;
|
||||||
},
|
},
|
||||||
@ -4201,8 +4184,7 @@
|
|||||||
// Derive key and IV
|
// Derive key and IV
|
||||||
var key = EvpKDF.create({
|
var key = EvpKDF.create({
|
||||||
keySize: keySize + ivSize
|
keySize: keySize + ivSize
|
||||||
})
|
}).compute(password, salt);
|
||||||
.compute(password, salt);
|
|
||||||
|
|
||||||
// Separate key and IV
|
// Separate key and IV
|
||||||
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
|
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
|
||||||
@ -4594,8 +4576,7 @@
|
|||||||
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
|
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
|
||||||
|
|
||||||
// Pad
|
// Pad
|
||||||
data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1))
|
data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
|
||||||
.
|
|
||||||
concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
|
concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
3631
JS/drpy2.js
Normal file
3631
JS/drpy2.js
Normal file
File diff suppressed because one or more lines are too long
16
JS/drpy2.min.js
vendored
16
JS/drpy2.min.js
vendored
@ -5,6 +5,17 @@ import "./node-rsa.js";
|
|||||||
import "./pako.min.js";
|
import "./pako.min.js";
|
||||||
import 模板 from "./模板.js";
|
import 模板 from "./模板.js";
|
||||||
import { gbkTool } from "./gbk.js";
|
import { gbkTool } from "./gbk.js";
|
||||||
|
import "./json5.js";
|
||||||
|
import "./jinja.js";
|
||||||
|
const _jinja2 = cheerio.jinja2;
|
||||||
|
cheerio.jinja2 = function(template, obj) {
|
||||||
|
try {
|
||||||
|
return jinja.render(template, obj)
|
||||||
|
} catch (e) {
|
||||||
|
console.log("新的jinja2库渲染失败,换回原始cheerio:" + e.message);
|
||||||
|
return _jinja2(template, obj)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function init_test() {
|
function init_test() {
|
||||||
console.log("init_test_start");
|
console.log("init_test_start");
|
||||||
@ -189,7 +200,7 @@ function pre() {
|
|||||||
}
|
}
|
||||||
let rule = {};
|
let rule = {};
|
||||||
let vercode = typeof pdfl === "function" ? "drpy2.1" : "drpy2";
|
let vercode = typeof pdfl === "function" ? "drpy2.1" : "drpy2";
|
||||||
const VERSION = vercode + " 3.9.50beta32 20240625";
|
const VERSION = vercode + " 3.9.51beta2 20240711";
|
||||||
const MOBILE_UA = "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.91 Mobile Safari/537.36";
|
const MOBILE_UA = "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.91 Mobile Safari/537.36";
|
||||||
const PC_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36";
|
const PC_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36";
|
||||||
const UA = "Mozilla/5.0";
|
const UA = "Mozilla/5.0";
|
||||||
@ -1702,7 +1713,8 @@ function categoryParse(cateObj) {
|
|||||||
}
|
}
|
||||||
let new_url;
|
let new_url;
|
||||||
new_url = cheerio.jinja2(url, {
|
new_url = cheerio.jinja2(url, {
|
||||||
fl: fl
|
fl: fl,
|
||||||
|
fyclass: cateObj.tid
|
||||||
});
|
});
|
||||||
url = new_url
|
url = new_url
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,7 @@ export
|
|||||||
function gbkTool() {
|
function gbkTool() {
|
||||||
var data = function(zipData) {
|
var data = function(zipData) {
|
||||||
var re = zipData.replace(/#(\d+)\$/g, function(a, b) {
|
var re = zipData.replace(/#(\d+)\$/g, function(a, b) {
|
||||||
return Array(+b + 3)
|
return Array(+b + 3).join('#');
|
||||||
.join('#');
|
|
||||||
})
|
})
|
||||||
.replace(/#/g, '####')
|
.replace(/#/g, '####')
|
||||||
.replace(/(\w\w):([\w#]+)(?:,|$)/g, function(a, hd, dt) {
|
.replace(/(\w\w):([\w#]+)(?:,|$)/g, function(a, hd, dt) {
|
||||||
@ -49,8 +48,7 @@ function gbkTool() {
|
|||||||
return encodeURIComponent(a);
|
return encodeURIComponent(a);
|
||||||
} else {
|
} else {
|
||||||
var key = code.toString(16);
|
var key = code.toString(16);
|
||||||
if (key.length != 4) key = ('000' + key)
|
if (key.length != 4) key = ('000' + key).match(/....$/)[0];
|
||||||
.match(/....$/)[0];
|
|
||||||
return U2Ghash[key] || a;
|
return U2Ghash[key] || a;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -62,8 +60,7 @@ function gbkTool() {
|
|||||||
} else {
|
} else {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
})
|
}).replace(/%[\w]{2}/g, function(a) {
|
||||||
.replace(/%[\w]{2}/g, function(a) {
|
|
||||||
return decodeURIComponent(a);
|
return decodeURIComponent(a);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
604
JS/jinja.js
Normal file
604
JS/jinja.js
Normal file
@ -0,0 +1,604 @@
|
|||||||
|
/*!
|
||||||
|
* Jinja Templating for JavaScript v0.1.8
|
||||||
|
* https://github.com/sstur/jinja-js
|
||||||
|
*
|
||||||
|
* This is a slimmed-down Jinja2 implementation [http://jinja.pocoo.org/]
|
||||||
|
*
|
||||||
|
* In the interest of simplicity, it deviates from Jinja2 as follows:
|
||||||
|
* - Line statements, cycle, super, macro tags and block nesting are not implemented
|
||||||
|
* - auto escapes html by default (the filter is "html" not "e")
|
||||||
|
* - Only "html" and "safe" filters are built in
|
||||||
|
* - Filters are not valid in expressions; `foo|length > 1` is not valid
|
||||||
|
* - Expression Tests (`if num is odd`) not implemented (`is` translates to `==` and `isnot` to `!=`)
|
||||||
|
*
|
||||||
|
* Notes:
|
||||||
|
* - if property is not found, but method '_get' exists, it will be called with the property name (and cached)
|
||||||
|
* - `{% for n in obj %}` iterates the object's keys; get the value with `{% for n in obj %}{{ obj[n] }}{% endfor %}`
|
||||||
|
* - subscript notation `a[0]` takes literals or simple variables but not `a[item.key]`
|
||||||
|
* - `.2` is not a valid number literal; use `0.2`
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*global require, exports, module, define */
|
||||||
|
|
||||||
|
(function(global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jinja = {}));
|
||||||
|
})(this, (function(jinja) {
|
||||||
|
"use strict";
|
||||||
|
var STRINGS = /'(\\.|[^'])*'|"(\\.|[^"'"])*"/g;
|
||||||
|
var IDENTS_AND_NUMS = /([$_a-z][$\w]*)|([+-]?\d+(\.\d+)?)/g;
|
||||||
|
var NUMBER = /^[+-]?\d+(\.\d+)?$/;
|
||||||
|
//non-primitive literals (array and object literals)
|
||||||
|
var NON_PRIMITIVES = /\[[@#~](,[@#~])*\]|\[\]|\{([@i]:[@#~])(,[@i]:[@#~])*\}|\{\}/g;
|
||||||
|
//bare identifiers such as variables and in object literals: {foo: 'value'}
|
||||||
|
var IDENTIFIERS = /[$_a-z][$\w]*/ig;
|
||||||
|
var VARIABLES = /i(\.i|\[[@#i]\])*/g;
|
||||||
|
var ACCESSOR = /(\.i|\[[@#i]\])/g;
|
||||||
|
var OPERATORS = /(===?|!==?|>=?|<=?|&&|\|\||[+\-\*\/%])/g;
|
||||||
|
//extended (english) operators
|
||||||
|
var EOPS = /(^|[^$\w])(and|or|not|is|isnot)([^$\w]|$)/g;
|
||||||
|
var LEADING_SPACE = /^\s+/;
|
||||||
|
var TRAILING_SPACE = /\s+$/;
|
||||||
|
|
||||||
|
var START_TOKEN = /\{\{\{|\{\{|\{%|\{#/;
|
||||||
|
var TAGS = {
|
||||||
|
'{{{': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}\}/,
|
||||||
|
'{{': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}/,
|
||||||
|
'{%': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?%\}/,
|
||||||
|
'{#': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?#\}/
|
||||||
|
};
|
||||||
|
|
||||||
|
var delimeters = {
|
||||||
|
'{%': 'directive',
|
||||||
|
'{{': 'output',
|
||||||
|
'{#': 'comment'
|
||||||
|
};
|
||||||
|
|
||||||
|
var operators = {
|
||||||
|
and: '&&',
|
||||||
|
or: '||',
|
||||||
|
not: '!',
|
||||||
|
is: '==',
|
||||||
|
isnot: '!='
|
||||||
|
};
|
||||||
|
|
||||||
|
var constants = {
|
||||||
|
'true': true,
|
||||||
|
'false': false,
|
||||||
|
'null': null
|
||||||
|
};
|
||||||
|
|
||||||
|
function Parser() {
|
||||||
|
this.nest = [];
|
||||||
|
this.compiled = [];
|
||||||
|
this.childBlocks = 0;
|
||||||
|
this.parentBlocks = 0;
|
||||||
|
this.isSilent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Parser.prototype.push = function(line) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
this.compiled.push(line);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.parse = function(src) {
|
||||||
|
this.tokenize(src);
|
||||||
|
return this.compiled;
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.tokenize = function(src) {
|
||||||
|
var lastEnd = 0,
|
||||||
|
parser = this,
|
||||||
|
trimLeading = false;
|
||||||
|
matchAll(src, START_TOKEN, function(open, index, src) {
|
||||||
|
//here we match the rest of the src against a regex for this tag
|
||||||
|
var match = src.slice(index + open.length).match(TAGS[open]);
|
||||||
|
match = (match ? match[0] : '');
|
||||||
|
//here we sub out strings so we don't get false matches
|
||||||
|
var simplified = match.replace(STRINGS, '@');
|
||||||
|
//if we don't have a close tag or there is a nested open tag
|
||||||
|
if (!match || ~simplified.indexOf(open)) {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
var inner = match.slice(0, 0 - open.length);
|
||||||
|
//check for white-space collapse syntax
|
||||||
|
if (inner.charAt(0) === '-') var wsCollapseLeft = true;
|
||||||
|
if (inner.slice(-1) === '-') var wsCollapseRight = true;
|
||||||
|
inner = inner.replace(/^-|-$/g, '').trim();
|
||||||
|
//if we're in raw mode and we are not looking at an "endraw" tag, move along
|
||||||
|
if (parser.rawMode && (open + inner) !== '{%endraw') {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
var text = src.slice(lastEnd, index);
|
||||||
|
lastEnd = index + open.length + match.length;
|
||||||
|
if (trimLeading) text = trimLeft(text);
|
||||||
|
if (wsCollapseLeft) text = trimRight(text);
|
||||||
|
if (wsCollapseRight) trimLeading = true;
|
||||||
|
if (open === '{{{') {
|
||||||
|
//liquid-style: make {{{x}}} => {{x|safe}}
|
||||||
|
open = '{{';
|
||||||
|
inner += '|safe';
|
||||||
|
}
|
||||||
|
parser.textHandler(text);
|
||||||
|
parser.tokenHandler(open, inner);
|
||||||
|
});
|
||||||
|
var text = src.slice(lastEnd);
|
||||||
|
if (trimLeading) text = trimLeft(text);
|
||||||
|
this.textHandler(text);
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.textHandler = function(text) {
|
||||||
|
this.push('write(' + JSON.stringify(text) + ');');
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.tokenHandler = function(open, inner) {
|
||||||
|
var type = delimeters[open];
|
||||||
|
if (type === 'directive') {
|
||||||
|
this.compileTag(inner);
|
||||||
|
} else if (type === 'output') {
|
||||||
|
var extracted = this.extractEnt(inner, STRINGS, '@');
|
||||||
|
//replace || operators with ~
|
||||||
|
extracted.src = extracted.src.replace(/\|\|/g, '~').split('|');
|
||||||
|
//put back || operators
|
||||||
|
extracted.src = extracted.src.map(function(part) {
|
||||||
|
return part.split('~').join('||');
|
||||||
|
});
|
||||||
|
var parts = this.injectEnt(extracted, '@');
|
||||||
|
if (parts.length > 1) {
|
||||||
|
var filters = parts.slice(1).map(this.parseFilter.bind(this));
|
||||||
|
this.push('filter(' + this.parseExpr(parts[0]) + ',' + filters.join(',') + ');');
|
||||||
|
} else {
|
||||||
|
this.push('filter(' + this.parseExpr(parts[0]) + ');');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.compileTag = function(str) {
|
||||||
|
var directive = str.split(' ')[0];
|
||||||
|
var handler = tagHandlers[directive];
|
||||||
|
if (!handler) {
|
||||||
|
throw new Error('Invalid tag: ' + str);
|
||||||
|
}
|
||||||
|
handler.call(this, str.slice(directive.length).trim());
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.parseFilter = function(src) {
|
||||||
|
src = src.trim();
|
||||||
|
var match = src.match(/[:(]/);
|
||||||
|
var i = match ? match.index : -1;
|
||||||
|
if (i < 0) return JSON.stringify([src]);
|
||||||
|
var name = src.slice(0, i);
|
||||||
|
var args = src.charAt(i) === ':' ? src.slice(i + 1) : src.slice(i + 1, -1);
|
||||||
|
args = this.parseExpr(args, {
|
||||||
|
terms: true
|
||||||
|
});
|
||||||
|
return '[' + JSON.stringify(name) + ',' + args + ']';
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.extractEnt = function(src, regex, placeholder) {
|
||||||
|
var subs = [],
|
||||||
|
isFunc = typeof placeholder == 'function';
|
||||||
|
src = src.replace(regex, function(str) {
|
||||||
|
var replacement = isFunc ? placeholder(str) : placeholder;
|
||||||
|
if (replacement) {
|
||||||
|
subs.push(str);
|
||||||
|
return replacement;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
src: src,
|
||||||
|
subs: subs
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.injectEnt = function(extracted, placeholder) {
|
||||||
|
var src = extracted.src,
|
||||||
|
subs = extracted.subs,
|
||||||
|
isArr = Array.isArray(src);
|
||||||
|
var arr = (isArr) ? src : [src];
|
||||||
|
var re = new RegExp('[' + placeholder + ']', 'g'),
|
||||||
|
i = 0;
|
||||||
|
arr.forEach(function(src, index) {
|
||||||
|
arr[index] = src.replace(re, function() {
|
||||||
|
return subs[i++];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return isArr ? arr : arr[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
//replace complex literals without mistaking subscript notation with array literals
|
||||||
|
Parser.prototype.replaceComplex = function(s) {
|
||||||
|
var parsed = this.extractEnt(s, /i(\.i|\[[@#i]\])+/g, 'v');
|
||||||
|
parsed.src = parsed.src.replace(NON_PRIMITIVES, '~');
|
||||||
|
return this.injectEnt(parsed, 'v');
|
||||||
|
};
|
||||||
|
|
||||||
|
//parse expression containing literals (including objects/arrays) and variables (including dot and subscript notation)
|
||||||
|
//valid expressions: `a + 1 > b.c or c == null`, `a and b[1] != c`, `(a < b) or (c < d and e)`, 'a || [1]`
|
||||||
|
Parser.prototype.parseExpr = function(src, opts) {
|
||||||
|
opts = opts || {};
|
||||||
|
//extract string literals -> @
|
||||||
|
var parsed1 = this.extractEnt(src, STRINGS, '@');
|
||||||
|
//note: this will catch {not: 1} and a.is; could we replace temporarily and then check adjacent chars?
|
||||||
|
parsed1.src = parsed1.src.replace(EOPS, function(s, before, op, after) {
|
||||||
|
return (op in operators) ? before + operators[op] + after : s;
|
||||||
|
});
|
||||||
|
//sub out non-string literals (numbers/true/false/null) -> #
|
||||||
|
// the distinction is necessary because @ can be object identifiers, # cannot
|
||||||
|
var parsed2 = this.extractEnt(parsed1.src, IDENTS_AND_NUMS, function(s) {
|
||||||
|
return (s in constants || NUMBER.test(s)) ? '#' : null;
|
||||||
|
});
|
||||||
|
//sub out object/variable identifiers -> i
|
||||||
|
var parsed3 = this.extractEnt(parsed2.src, IDENTIFIERS, 'i');
|
||||||
|
//remove white-space
|
||||||
|
parsed3.src = parsed3.src.replace(/\s+/g, '');
|
||||||
|
|
||||||
|
//the rest of this is simply to boil the expression down and check validity
|
||||||
|
var simplified = parsed3.src;
|
||||||
|
//sub out complex literals (objects/arrays) -> ~
|
||||||
|
// the distinction is necessary because @ and # can be subscripts but ~ cannot
|
||||||
|
while (simplified !== (simplified = this.replaceComplex(simplified)));
|
||||||
|
//now @ represents strings, # represents other primitives and ~ represents non-primitives
|
||||||
|
//replace complex variables (those with dot/subscript accessors) -> v
|
||||||
|
while (simplified !== (simplified = simplified.replace(/i(\.i|\[[@#i]\])+/, 'v')));
|
||||||
|
//empty subscript or complex variables in subscript, are not permitted
|
||||||
|
simplified = simplified.replace(/[iv]\[v?\]/g, 'x');
|
||||||
|
//sub in "i" for @ and # and ~ and v (now "i" represents all literals, variables and identifiers)
|
||||||
|
simplified = simplified.replace(/[@#~v]/g, 'i');
|
||||||
|
//sub out operators
|
||||||
|
simplified = simplified.replace(OPERATORS, '%');
|
||||||
|
//allow 'not' unary operator
|
||||||
|
simplified = simplified.replace(/!+[i]/g, 'i');
|
||||||
|
var terms = opts.terms ? simplified.split(',') : [simplified];
|
||||||
|
terms.forEach(function(term) {
|
||||||
|
//simplify logical grouping
|
||||||
|
while (term !== (term = term.replace(/\(i(%i)*\)/g, 'i')));
|
||||||
|
if (!term.match(/^i(%i)*/)) {
|
||||||
|
throw new Error('Invalid expression: ' + src + " " + term);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
parsed3.src = parsed3.src.replace(VARIABLES, this.parseVar.bind(this));
|
||||||
|
parsed2.src = this.injectEnt(parsed3, 'i');
|
||||||
|
parsed1.src = this.injectEnt(parsed2, '#');
|
||||||
|
return this.injectEnt(parsed1, '@');
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.parseVar = function(src) {
|
||||||
|
var args = Array.prototype.slice.call(arguments);
|
||||||
|
var str = args.pop(),
|
||||||
|
index = args.pop();
|
||||||
|
//quote bare object identifiers (might be a reserved word like {while: 1})
|
||||||
|
if (src === 'i' && str.charAt(index + 1) === ':') {
|
||||||
|
return '"i"';
|
||||||
|
}
|
||||||
|
var parts = ['"i"'];
|
||||||
|
src.replace(ACCESSOR, function(part) {
|
||||||
|
if (part === '.i') {
|
||||||
|
parts.push('"i"');
|
||||||
|
} else if (part === '[i]') {
|
||||||
|
parts.push('get("i")');
|
||||||
|
} else {
|
||||||
|
parts.push(part.slice(1, -1));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return 'get(' + parts.join(',') + ')';
|
||||||
|
};
|
||||||
|
|
||||||
|
//escapes a name to be used as a javascript identifier
|
||||||
|
Parser.prototype.escName = function(str) {
|
||||||
|
return str.replace(/\W/g, function(s) {
|
||||||
|
return '$' + s.charCodeAt(0).toString(16);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Parser.prototype.parseQuoted = function(str) {
|
||||||
|
if (str.charAt(0) === "'") {
|
||||||
|
str = str.slice(1, -1).replace(/\\.|"/, function(s) {
|
||||||
|
if (s === "\\'") return "'";
|
||||||
|
return s.charAt(0) === '\\' ? s : ('\\' + s);
|
||||||
|
});
|
||||||
|
str = '"' + str + '"';
|
||||||
|
}
|
||||||
|
//todo: try/catch or deal with invalid characters (linebreaks, control characters)
|
||||||
|
return JSON.parse(str);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//the context 'this' inside tagHandlers is the parser instance
|
||||||
|
var tagHandlers = {
|
||||||
|
'if': function(expr) {
|
||||||
|
this.push('if (' + this.parseExpr(expr) + ') {');
|
||||||
|
this.nest.unshift('if');
|
||||||
|
},
|
||||||
|
'else': function() {
|
||||||
|
if (this.nest[0] === 'for') {
|
||||||
|
this.push('}, function() {');
|
||||||
|
} else {
|
||||||
|
this.push('} else {');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'elseif': function(expr) {
|
||||||
|
this.push('} else if (' + this.parseExpr(expr) + ') {');
|
||||||
|
},
|
||||||
|
'endif': function() {
|
||||||
|
this.nest.shift();
|
||||||
|
this.push('}');
|
||||||
|
},
|
||||||
|
'for': function(str) {
|
||||||
|
var i = str.indexOf(' in ');
|
||||||
|
var name = str.slice(0, i).trim();
|
||||||
|
var expr = str.slice(i + 4).trim();
|
||||||
|
this.push('each(' + this.parseExpr(expr) + ',' + JSON.stringify(name) + ',function() {');
|
||||||
|
this.nest.unshift('for');
|
||||||
|
},
|
||||||
|
'endfor': function() {
|
||||||
|
this.nest.shift();
|
||||||
|
this.push('});');
|
||||||
|
},
|
||||||
|
'raw': function() {
|
||||||
|
this.rawMode = true;
|
||||||
|
},
|
||||||
|
'endraw': function() {
|
||||||
|
this.rawMode = false;
|
||||||
|
},
|
||||||
|
'set': function(stmt) {
|
||||||
|
var i = stmt.indexOf('=');
|
||||||
|
var name = stmt.slice(0, i).trim();
|
||||||
|
var expr = stmt.slice(i + 1).trim();
|
||||||
|
this.push('set(' + JSON.stringify(name) + ',' + this.parseExpr(expr) + ');');
|
||||||
|
},
|
||||||
|
'block': function(name) {
|
||||||
|
if (this.isParent) {
|
||||||
|
++this.parentBlocks;
|
||||||
|
var blockName = 'block_' + (this.escName(name) || this.parentBlocks);
|
||||||
|
this.push('block(typeof ' + blockName + ' == "function" ? ' + blockName + ' : function() {');
|
||||||
|
} else if (this.hasParent) {
|
||||||
|
this.isSilent = false;
|
||||||
|
++this.childBlocks;
|
||||||
|
blockName = 'block_' + (this.escName(name) || this.childBlocks);
|
||||||
|
this.push('function ' + blockName + '() {');
|
||||||
|
}
|
||||||
|
this.nest.unshift('block');
|
||||||
|
},
|
||||||
|
'endblock': function() {
|
||||||
|
this.nest.shift();
|
||||||
|
if (this.isParent) {
|
||||||
|
this.push('});');
|
||||||
|
} else if (this.hasParent) {
|
||||||
|
this.push('}');
|
||||||
|
this.isSilent = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'extends': function(name) {
|
||||||
|
name = this.parseQuoted(name);
|
||||||
|
var parentSrc = this.readTemplateFile(name);
|
||||||
|
this.isParent = true;
|
||||||
|
this.tokenize(parentSrc);
|
||||||
|
this.isParent = false;
|
||||||
|
this.hasParent = true;
|
||||||
|
//silence output until we enter a child block
|
||||||
|
this.isSilent = true;
|
||||||
|
},
|
||||||
|
'include': function(name) {
|
||||||
|
name = this.parseQuoted(name);
|
||||||
|
var incSrc = this.readTemplateFile(name);
|
||||||
|
this.isInclude = true;
|
||||||
|
this.tokenize(incSrc);
|
||||||
|
this.isInclude = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//liquid style
|
||||||
|
tagHandlers.assign = tagHandlers.set;
|
||||||
|
//python/django style
|
||||||
|
tagHandlers.elif = tagHandlers.elseif;
|
||||||
|
|
||||||
|
var getRuntime = function runtime(data, opts) {
|
||||||
|
var defaults = {
|
||||||
|
autoEscape: 'toJson'
|
||||||
|
};
|
||||||
|
var _toString = Object.prototype.toString;
|
||||||
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
var getKeys = Object.keys || function(obj) {
|
||||||
|
var keys = [];
|
||||||
|
for (var n in obj) if (_hasOwnProperty.call(obj, n)) keys.push(n);
|
||||||
|
return keys;
|
||||||
|
};
|
||||||
|
var isArray = Array.isArray || function(obj) {
|
||||||
|
return _toString.call(obj) === '[object Array]';
|
||||||
|
};
|
||||||
|
var create = Object.create || function(obj) {
|
||||||
|
function F() {}
|
||||||
|
|
||||||
|
F.prototype = obj;
|
||||||
|
return new F();
|
||||||
|
};
|
||||||
|
var toString = function(val) {
|
||||||
|
if (val == null) return '';
|
||||||
|
return (typeof val.toString == 'function') ? val.toString() : _toString.call(val);
|
||||||
|
};
|
||||||
|
var extend = function(dest, src) {
|
||||||
|
var keys = getKeys(src);
|
||||||
|
for (var i = 0, len = keys.length; i < len; i++) {
|
||||||
|
var key = keys[i];
|
||||||
|
dest[key] = src[key];
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
};
|
||||||
|
//get a value, lexically, starting in current context; a.b -> get("a","b")
|
||||||
|
var get = function() {
|
||||||
|
var val, n = arguments[0],
|
||||||
|
c = stack.length;
|
||||||
|
while (c--) {
|
||||||
|
val = stack[c][n];
|
||||||
|
if (typeof val != 'undefined') break;
|
||||||
|
}
|
||||||
|
for (var i = 1, len = arguments.length; i < len; i++) {
|
||||||
|
if (val == null) continue;
|
||||||
|
n = arguments[i];
|
||||||
|
val = (_hasOwnProperty.call(val, n)) ? val[n] : (typeof val._get == 'function' ? (val[n] = val._get(n)) : null);
|
||||||
|
}
|
||||||
|
return (val == null) ? '' : val;
|
||||||
|
};
|
||||||
|
var set = function(n, val) {
|
||||||
|
stack[stack.length - 1][n] = val;
|
||||||
|
};
|
||||||
|
var push = function(ctx) {
|
||||||
|
stack.push(ctx || {});
|
||||||
|
};
|
||||||
|
var pop = function() {
|
||||||
|
stack.pop();
|
||||||
|
};
|
||||||
|
var write = function(str) {
|
||||||
|
output.push(str);
|
||||||
|
};
|
||||||
|
var filter = function(val) {
|
||||||
|
for (var i = 1, len = arguments.length; i < len; i++) {
|
||||||
|
var arr = arguments[i],
|
||||||
|
name = arr[0],
|
||||||
|
filter = filters[name];
|
||||||
|
if (filter) {
|
||||||
|
arr[0] = val;
|
||||||
|
//now arr looks like [val, arg1, arg2]
|
||||||
|
val = filter.apply(data, arr);
|
||||||
|
} else {
|
||||||
|
throw new Error('Invalid filter: ' + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (opts.autoEscape && name !== opts.autoEscape && name !== 'safe') {
|
||||||
|
//auto escape if not explicitly safe or already escaped
|
||||||
|
val = filters[opts.autoEscape].call(data, val);
|
||||||
|
}
|
||||||
|
output.push(val);
|
||||||
|
};
|
||||||
|
var each = function(obj, loopvar, fn1, fn2) {
|
||||||
|
if (obj == null) return;
|
||||||
|
var arr = isArray(obj) ? obj : getKeys(obj),
|
||||||
|
len = arr.length;
|
||||||
|
var ctx = {
|
||||||
|
loop: {
|
||||||
|
length: len,
|
||||||
|
first: arr[0],
|
||||||
|
last: arr[len - 1]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
push(ctx);
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
extend(ctx.loop, {
|
||||||
|
index: i + 1,
|
||||||
|
index0: i
|
||||||
|
});
|
||||||
|
fn1(ctx[loopvar] = arr[i]);
|
||||||
|
}
|
||||||
|
if (len === 0 && fn2) fn2();
|
||||||
|
pop();
|
||||||
|
};
|
||||||
|
var block = function(fn) {
|
||||||
|
push();
|
||||||
|
fn();
|
||||||
|
pop();
|
||||||
|
};
|
||||||
|
var render = function() {
|
||||||
|
return output.join('');
|
||||||
|
};
|
||||||
|
data = data || {};
|
||||||
|
opts = extend(defaults, opts || {});
|
||||||
|
var filters = extend({
|
||||||
|
html: function(val) {
|
||||||
|
return toString(val)
|
||||||
|
.split('&').join('&')
|
||||||
|
.split('<').join('<')
|
||||||
|
.split('>').join('>')
|
||||||
|
.split('"').join('"');
|
||||||
|
},
|
||||||
|
safe: function(val) {
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
toJson: function(val) {
|
||||||
|
if (typeof val === 'object') {
|
||||||
|
return JSON.stringify(val);
|
||||||
|
}
|
||||||
|
return toString(val);
|
||||||
|
}
|
||||||
|
}, opts.filters || {});
|
||||||
|
var stack = [create(data || {})],
|
||||||
|
output = [];
|
||||||
|
return {
|
||||||
|
get: get,
|
||||||
|
set: set,
|
||||||
|
push: push,
|
||||||
|
pop: pop,
|
||||||
|
write: write,
|
||||||
|
filter: filter,
|
||||||
|
each: each,
|
||||||
|
block: block,
|
||||||
|
render: render
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var runtime;
|
||||||
|
|
||||||
|
jinja.compile = function(markup, opts) {
|
||||||
|
opts = opts || {};
|
||||||
|
var parser = new Parser();
|
||||||
|
parser.readTemplateFile = this.readTemplateFile;
|
||||||
|
var code = [];
|
||||||
|
code.push('function render($) {');
|
||||||
|
code.push('var get = $.get, set = $.set, push = $.push, pop = $.pop, write = $.write, filter = $.filter, each = $.each, block = $.block;');
|
||||||
|
code.push.apply(code, parser.parse(markup));
|
||||||
|
code.push('return $.render();');
|
||||||
|
code.push('}');
|
||||||
|
code = code.join('\n');
|
||||||
|
if (opts.runtime === false) {
|
||||||
|
var fn = new Function('data', 'options', 'return (' + code + ')(runtime(data, options))');
|
||||||
|
} else {
|
||||||
|
runtime = runtime || (runtime = getRuntime.toString());
|
||||||
|
fn = new Function('data', 'options', 'return (' + code + ')((' + runtime + ')(data, options))');
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
render: fn
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
jinja.render = function(markup, data, opts) {
|
||||||
|
var tmpl = jinja.compile(markup);
|
||||||
|
return tmpl.render(data, opts);
|
||||||
|
};
|
||||||
|
|
||||||
|
jinja.templateFiles = [];
|
||||||
|
|
||||||
|
jinja.readTemplateFile = function(name) {
|
||||||
|
var templateFiles = this.templateFiles || [];
|
||||||
|
var templateFile = templateFiles[name];
|
||||||
|
if (templateFile == null) {
|
||||||
|
throw new Error('Template file not found: ' + name);
|
||||||
|
}
|
||||||
|
return templateFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Helpers
|
||||||
|
*/
|
||||||
|
|
||||||
|
function trimLeft(str) {
|
||||||
|
return str.replace(LEADING_SPACE, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function trimRight(str) {
|
||||||
|
return str.replace(TRAILING_SPACE, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function matchAll(str, reg, fn) {
|
||||||
|
//copy as global
|
||||||
|
reg = new RegExp(reg.source, 'g' + (reg.ignoreCase ? 'i' : '') + (reg.multiline ? 'm' : ''));
|
||||||
|
var match;
|
||||||
|
while ((match = reg.exec(str))) {
|
||||||
|
var result = fn(match[0], match.index, str);
|
||||||
|
if (typeof result == 'number') {
|
||||||
|
reg.lastIndex = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
1784
JS/json5.js
Normal file
1784
JS/json5.js
Normal file
File diff suppressed because one or more lines are too long
461
JS/node-rsa.js
461
JS/node-rsa.js
File diff suppressed because it is too large
Load Diff
21
JS/pako.min.js
vendored
21
JS/pako.min.js
vendored
@ -1,6 +1,5 @@
|
|||||||
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ ! function(t, e) {
|
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ ! function(t, e) {
|
||||||
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t = "undefined" != typeof globalThis ? globalThis : t || self)
|
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t = "undefined" != typeof globalThis ? globalThis : t || self).pako = {})
|
||||||
.pako = {})
|
|
||||||
}(this, (function(t) {
|
}(this, (function(t) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@ -360,8 +359,7 @@
|
|||||||
}, Bt = t => {
|
}, Bt = t => {
|
||||||
const e = Nt(t);
|
const e = Nt(t);
|
||||||
var a;
|
var a;
|
||||||
return e === tt && ((a = t.state)
|
return e === tt && ((a = t.state).window_size = 2 * a.w_size, kt(a.head), a.max_lazy_match = It[a.level].max_lazy, a.good_match = It[a.level].good_length, a.nice_match = It[a.level].nice_length, a.max_chain_length = It[a.level].max_chain, a.strstart = 0, a.block_start = 0, a.lookahead = 0, a.insert = 0, a.match_length = a.prev_length = 2, a.match_available = 0, a.ins_h = 0), e
|
||||||
.window_size = 2 * a.w_size, kt(a.head), a.max_lazy_match = It[a.level].max_lazy, a.good_match = It[a.level].good_length, a.nice_match = It[a.level].nice_length, a.max_chain_length = It[a.level].max_chain, a.strstart = 0, a.block_start = 0, a.lookahead = 0, a.insert = 0, a.match_length = a.prev_length = 2, a.match_available = 0, a.ins_h = 0), e
|
|
||||||
}, Ct = (t, e, a, i, n, s) => {
|
}, Ct = (t, e, a, i, n, s) => {
|
||||||
if (!t) return at;
|
if (!t) return at;
|
||||||
let r = 1;
|
let r = 1;
|
||||||
@ -530,16 +528,14 @@
|
|||||||
for (let t = 0; t < 256; t++) Yt[t] = t >= 252 ? 6 : t >= 248 ? 5 : t >= 240 ? 4 : t >= 224 ? 3 : t >= 192 ? 2 : 1;
|
for (let t = 0; t < 256; t++) Yt[t] = t >= 252 ? 6 : t >= 248 ? 5 : t >= 240 ? 4 : t >= 224 ? 3 : t >= 192 ? 2 : 1;
|
||||||
Yt[254] = Yt[254] = 1;
|
Yt[254] = Yt[254] = 1;
|
||||||
var Gt = t => {
|
var Gt = t => {
|
||||||
if ("function" == typeof TextEncoder && TextEncoder.prototype.encode) return (new TextEncoder)
|
if ("function" == typeof TextEncoder && TextEncoder.prototype.encode) return (new TextEncoder).encode(t);
|
||||||
.encode(t);
|
|
||||||
let e, a, i, n, s, r = t.length, o = 0;
|
let e, a, i, n, s, r = t.length, o = 0;
|
||||||
for (n = 0; n < r; n++) a = t.charCodeAt(n), 55296 == (64512 & a) && n + 1 < r && (i = t.charCodeAt(n + 1), 56320 == (64512 & i) && (a = 65536 + (a - 55296 << 10) + (i - 56320), n++)), o += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4;
|
for (n = 0; n < r; n++) a = t.charCodeAt(n), 55296 == (64512 & a) && n + 1 < r && (i = t.charCodeAt(n + 1), 56320 == (64512 & i) && (a = 65536 + (a - 55296 << 10) + (i - 56320), n++)), o += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4;
|
||||||
for (e = new Uint8Array(o), s = 0, n = 0; s < o; n++) a = t.charCodeAt(n), 55296 == (64512 & a) && n + 1 < r && (i = t.charCodeAt(n + 1), 56320 == (64512 & i) && (a = 65536 + (a - 55296 << 10) + (i - 56320), n++)), a < 128 ? e[s++] = a : a < 2048 ? (e[s++] = 192 | a >>> 6, e[s++] = 128 | 63 & a) : a < 65536 ? (e[s++] = 224 | a >>> 12, e[s++] = 128 | a >>> 6 & 63, e[s++] = 128 | 63 & a) : (e[s++] = 240 | a >>> 18, e[s++] = 128 | a >>> 12 & 63, e[s++] = 128 | a >>> 6 & 63, e[s++] = 128 | 63 & a);
|
for (e = new Uint8Array(o), s = 0, n = 0; s < o; n++) a = t.charCodeAt(n), 55296 == (64512 & a) && n + 1 < r && (i = t.charCodeAt(n + 1), 56320 == (64512 & i) && (a = 65536 + (a - 55296 << 10) + (i - 56320), n++)), a < 128 ? e[s++] = a : a < 2048 ? (e[s++] = 192 | a >>> 6, e[s++] = 128 | 63 & a) : a < 65536 ? (e[s++] = 224 | a >>> 12, e[s++] = 128 | a >>> 6 & 63, e[s++] = 128 | 63 & a) : (e[s++] = 240 | a >>> 18, e[s++] = 128 | a >>> 12 & 63, e[s++] = 128 | a >>> 6 & 63, e[s++] = 128 | 63 & a);
|
||||||
return e
|
return e
|
||||||
}, Xt = (t, e) => {
|
}, Xt = (t, e) => {
|
||||||
const a = e || t.length;
|
const a = e || t.length;
|
||||||
if ("function" == typeof TextDecoder && TextDecoder.prototype.decode) return (new TextDecoder)
|
if ("function" == typeof TextDecoder && TextDecoder.prototype.decode) return (new TextDecoder).decode(t.subarray(0, e));
|
||||||
.decode(t.subarray(0, e));
|
|
||||||
let i, n;
|
let i, n;
|
||||||
const s = new Array(2 * a);
|
const s = new Array(2 * a);
|
||||||
for (n = 0, i = 0; i < a;) {
|
for (n = 0, i = 0; i < a;) {
|
||||||
@ -628,12 +624,10 @@
|
|||||||
Deflate: re,
|
Deflate: re,
|
||||||
deflate: oe,
|
deflate: oe,
|
||||||
deflateRaw: function(t, e) {
|
deflateRaw: function(t, e) {
|
||||||
return (e = e || {})
|
return (e = e || {}).raw = !0, oe(t, e)
|
||||||
.raw = !0, oe(t, e)
|
|
||||||
},
|
},
|
||||||
gzip: function(t, e) {
|
gzip: function(t, e) {
|
||||||
return (e = e || {})
|
return (e = e || {}).gzip = !0, oe(t, e)
|
||||||
.gzip = !0, oe(t, e)
|
|
||||||
},
|
},
|
||||||
constants: K
|
constants: K
|
||||||
};
|
};
|
||||||
@ -1297,8 +1291,7 @@
|
|||||||
Inflate: ra,
|
Inflate: ra,
|
||||||
inflate: oa,
|
inflate: oa,
|
||||||
inflateRaw: function(t, e) {
|
inflateRaw: function(t, e) {
|
||||||
return (e = e || {})
|
return (e = e || {}).raw = !0, oa(t, e)
|
||||||
.raw = !0, oa(t, e)
|
|
||||||
},
|
},
|
||||||
ungzip: oa,
|
ungzip: oa,
|
||||||
constants: K
|
constants: K
|
||||||
|
250
JS/模板.js
250
JS/模板.js
@ -1,4 +1,4 @@
|
|||||||
if (typeof Object.assign != 'function') {
|
if (typeof Object.assign !== 'function') {
|
||||||
Object.assign = function() {
|
Object.assign = function() {
|
||||||
let target = arguments[0];
|
let target = arguments[0];
|
||||||
for (let i = 1; i < arguments.length; i++) {
|
for (let i = 1; i < arguments.length; i++) {
|
||||||
@ -13,8 +13,50 @@ if (typeof Object.assign != 'function') {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通用免嗅探播放
|
||||||
|
let common_lazy = `js:
|
||||||
|
let html = request(input);
|
||||||
|
let hconf = html.match(/r player_.*?=(.*?)</)[1];
|
||||||
|
let json = JSON5.parse(hconf);
|
||||||
|
let url = json.url;
|
||||||
|
if (json.encrypt == '1') {
|
||||||
|
url = unescape(url);
|
||||||
|
} else if (json.encrypt == '2') {
|
||||||
|
url = unescape(base64Decode(url));
|
||||||
|
}
|
||||||
|
if (/\\.(m3u8|mp4|m4a|mp3)/.test(url)) {
|
||||||
|
input = {
|
||||||
|
parse: 0,
|
||||||
|
jx: 0,
|
||||||
|
url: url,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
input;
|
||||||
|
}`;
|
||||||
|
// 默认嗅探播放
|
||||||
|
|
||||||
|
let def_lazy = `js:
|
||||||
|
input = { parse: 1, url: input, js: '' };`;
|
||||||
|
// 采集站播放
|
||||||
|
|
||||||
|
let cj_lazy = `js:
|
||||||
|
if (/\\.(m3u8|mp4)/.test(input)) {
|
||||||
|
input = { parse: 0, url: input };
|
||||||
|
} else {
|
||||||
|
if (rule.parse_url.startsWith('json:')) {
|
||||||
|
let purl = rule.parse_url.replace('json:', '') + input;
|
||||||
|
let html = request(purl);
|
||||||
|
let json = JSON.parse(html);
|
||||||
|
if (json.url) {
|
||||||
|
input = { parse: 0, url: json.url };
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
input = rule.parse_url + input;
|
||||||
|
}
|
||||||
|
}`;
|
||||||
|
|
||||||
function getMubans() {
|
function getMubans() {
|
||||||
var mubanDict = { // 模板字典
|
const mubanDict = { // 模板字典
|
||||||
mx: {
|
mx: {
|
||||||
title: '',
|
title: '',
|
||||||
host: '',
|
host: '',
|
||||||
@ -28,15 +70,15 @@ function getMubans() {
|
|||||||
'User-Agent': 'MOBILE_UA',
|
'User-Agent': 'MOBILE_UA',
|
||||||
},
|
},
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: '.cbox_list;*;*;*;*;*',
|
|
||||||
double: true,
|
double: true,
|
||||||
|
推荐: '.cbox_list;*;*;*;*;*',
|
||||||
一级: 'ul.vodlist li;a&&title;a&&data-original;.pic_text&&Text;a&&href',
|
一级: 'ul.vodlist li;a&&title;a&&data-original;.pic_text&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
title: 'h2&&Text;.detail_list&&ul:eq(1)&&li&&a:eq(2)&&Text',
|
title: 'h2&&Text;.content_detail:eq(1)&&li&&a:eq(2)&&Text',
|
||||||
img: '.vodlist_thumb&&data-original',
|
img: '.vodlist_thumb&&data-original',
|
||||||
desc: '.content_detail&&li:eq(1)&&Text;.detail_list&&ul:eq(1)&&li&&a&&Text;.detail_list&&ul:eq(1)&&li&&a:eq(1)&&Text;.detail_list&&ul:eq(1)&&li:eq(2)&&Text;.detail_list&&ul:eq(1)&&li:eq(3)&&Text',
|
desc: '.content_detail:eq(1)&&li:eq(1)&&Text;.content_detail:eq(1)&&li&&a&&Text;.content_detail:eq(1)&&li&&a:eq(1)&&Text;.content_detail:eq(1)&&li:eq(2)&&Text;.content_detail:eq(1)&&li:eq(3)&&Text',
|
||||||
content: '.content_desc&&span&&Text',
|
content: '.content_desc&&span&&Text',
|
||||||
tabs: '.play_source_tab&&a',
|
tabs: '.play_source_tab&&a',
|
||||||
lists: '.content_playlist:eq(#id) li',
|
lists: '.content_playlist:eq(#id) li',
|
||||||
@ -54,20 +96,21 @@ function getMubans() {
|
|||||||
headers: { //网站的请求头,完整支持所有的,常带ua和cookies
|
headers: { //网站的请求头,完整支持所有的,常带ua和cookies
|
||||||
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
||||||
},
|
},
|
||||||
class_parse: '.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html',
|
class_parse: '.navbar-items li:gt(0):lt(10);a&&Text;a&&href;/(\\d+)',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
||||||
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": "h1&&Text;.module-info-tag&&Text",
|
title: 'h1&&Text;.module-info-tag-link:eq(-1)&&Text',
|
||||||
"img": ".lazyload&&data-original",
|
img: '.lazyload&&data-original||data-src||src',
|
||||||
"desc": ".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text",
|
desc: '.module-info-item:eq(-2)&&Text;.module-info-tag-link&&Text;.module-info-tag-link:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(1)&&Text',
|
||||||
"content": ".module-info-introduction&&Text",
|
content: '.module-info-introduction&&Text',
|
||||||
"tabs": ".module-tab-item",
|
tabs: '.module-tab-item',
|
||||||
"lists": ".module-play-list:eq(#id) a"
|
lists: '.module-play-list:eq(#id) a',
|
||||||
|
tab_text: 'div--small&&Text',
|
||||||
},
|
},
|
||||||
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
|
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
|
||||||
},
|
},
|
||||||
@ -79,20 +122,21 @@ function getMubans() {
|
|||||||
searchable: 2, //是否启用全局搜索,
|
searchable: 2, //是否启用全局搜索,
|
||||||
quickSearch: 0, //是否启用快速搜索,
|
quickSearch: 0, //是否启用快速搜索,
|
||||||
filterable: 0, //是否启用分类筛选,
|
filterable: 0, //是否启用分类筛选,
|
||||||
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?).html',
|
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?)\.html',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
||||||
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": "h1&&Text;.tag-link&&Text",
|
title: 'h1&&Text;.tag-link&&Text',
|
||||||
"img": ".module-item-pic&&img&&data-src",
|
img: '.module-item-pic&&img&&data-src',
|
||||||
"desc": ".video-info-items:eq(0)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(2)&&Text;.video-info-items:eq(3)&&Text",
|
desc: '.video-info-items:eq(3)&&Text;.tag-link:eq(2)&&Text;.tag-link:eq(1)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(0)&&Text',
|
||||||
"content": ".vod_content&&Text",
|
content: '.vod_content&&Text',
|
||||||
"tabs": ".module-tab-item",
|
tabs: '.module-tab-item',
|
||||||
"lists": ".module-player-list:eq(#id)&&.scroll-content&&a"
|
lists: '.module-player-list:eq(#id)&&.scroll-content&&a',
|
||||||
|
tab_text: 'div--small&&Text',
|
||||||
},
|
},
|
||||||
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
|
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
|
||||||
},
|
},
|
||||||
@ -107,22 +151,23 @@ function getMubans() {
|
|||||||
headers: { //网站的请求头,完整支持所有的,常带ua和cookies
|
headers: { //网站的请求头,完整支持所有的,常带ua和cookies
|
||||||
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
||||||
},
|
},
|
||||||
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html',
|
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||||
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": ".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text",
|
title: '.myui-content__detail .title--span&&Text;.myui-content__detail p.data:eq(3)&&Text',
|
||||||
"img": ".myui-content__thumb .lazyload&&data-original",
|
img: '.myui-content__thumb .lazyload&&data-original',
|
||||||
"desc": ".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text",
|
desc: '.myui-content__detail p.otherbox&&Text;.year&&Text;.myui-content__detail p.data:eq(4)&&Text;.myui-content__detail p.data:eq(2)&&Text;.myui-content__detail p.data:eq(0)&&Text',
|
||||||
"content": ".content&&Text",
|
content: '.content&&Text',
|
||||||
"tabs": ".nav-tabs:eq(0) li",
|
tabs: '.myui-panel__head&&li',
|
||||||
"lists": ".myui-content__list:eq(#id) li"
|
// tabs: '.nav-tabs&&li',
|
||||||
|
lists: '.myui-content__list:eq(#id) li',
|
||||||
},
|
},
|
||||||
搜索: '#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
搜索: '#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
|
||||||
},
|
},
|
||||||
首图2: {
|
首图2: {
|
||||||
title: '',
|
title: '',
|
||||||
@ -134,25 +179,26 @@ function getMubans() {
|
|||||||
filterable: 0, //是否启用分类筛选,
|
filterable: 0, //是否启用分类筛选,
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'UC_UA', // "Cookie": ""
|
'User-Agent': 'UC_UA', // "Cookie": ""
|
||||||
}, // class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
|
},
|
||||||
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
|
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
|
||||||
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": ".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text",
|
title: '.stui-content__detail .title&&Text;.stui-content__detail&&p:eq(-2)&&a&&Text',
|
||||||
"img": ".stui-content__thumb .lazyload&&data-original",
|
title1: '.stui-content__detail .title&&Text;.stui-content__detail&&p&&Text',
|
||||||
"desc": ".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text",
|
img: '.stui-content__thumb .lazyload&&data-original',
|
||||||
"content": ".detail&&Text",
|
desc: '.stui-content__detail p&&Text;.stui-content__detail&&p:eq(-2)&&a:eq(2)&&Text;.stui-content__detail&&p:eq(-2)&&a:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text;.stui-content__detail p:eq(1)&&Text',
|
||||||
"tabs": ".stui-vodlist__head h3",
|
desc1: '.stui-content__detail p:eq(4)&&Text;;;.stui-content__detail p:eq(1)&&Text',
|
||||||
"lists": ".stui-content__playlist:eq(#id) li"
|
content: '.detail&&Text',
|
||||||
|
tabs: '.stui-pannel__head h3',
|
||||||
|
tabs1: '.stui-vodlist__head h3',
|
||||||
|
lists: '.stui-content__playlist:eq(#id) li',
|
||||||
},
|
},
|
||||||
搜索: 'ul.stui-vodlist__media:eq(0),ul.stui-vodlist:eq(0),#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
搜索: 'ul.stui-vodlist__media,ul.stui-vodlist,#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
|
||||||
搜索1: 'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
|
||||||
搜索2: 'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
|
||||||
},
|
},
|
||||||
默认: {
|
默认: {
|
||||||
title: '',
|
title: '',
|
||||||
@ -161,7 +207,7 @@ function getMubans() {
|
|||||||
searchUrl: '',
|
searchUrl: '',
|
||||||
searchable: 2,
|
searchable: 2,
|
||||||
quickSearch: 0,
|
quickSearch: 0,
|
||||||
filterable: 1,
|
filterable: 0,
|
||||||
filter: '',
|
filter: '',
|
||||||
filter_url: '',
|
filter_url: '',
|
||||||
filter_def: {},
|
filter_def: {},
|
||||||
@ -172,7 +218,7 @@ function getMubans() {
|
|||||||
class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
|
class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
|
||||||
cate_exclude: '',
|
cate_exclude: '',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: `js:input = {parse: 1, url: input, js: ''}`,
|
lazy: def_lazy,
|
||||||
double: true,
|
double: true,
|
||||||
推荐: '列表1;列表2;标题;图片;描述;链接;详情',
|
推荐: '列表1;列表2;标题;图片;描述;链接;详情',
|
||||||
一级: '列表;标题;图片;描述;链接;详情',
|
一级: '列表;标题;图片;描述;链接;详情',
|
||||||
@ -185,7 +231,7 @@ function getMubans() {
|
|||||||
lists: 'xx:eq(#id)&&a',
|
lists: 'xx:eq(#id)&&a',
|
||||||
tab_text: 'body&&Text',
|
tab_text: 'body&&Text',
|
||||||
list_text: 'body&&Text',
|
list_text: 'body&&Text',
|
||||||
list_url: 'a&&href'
|
list_url: 'a&&href',
|
||||||
},
|
},
|
||||||
搜索: '列表;标题;图片;描述;链接;详情',
|
搜索: '列表;标题;图片;描述;链接;详情',
|
||||||
},
|
},
|
||||||
@ -199,21 +245,21 @@ function getMubans() {
|
|||||||
filterable: 0, //是否启用分类筛选,
|
filterable: 0, //是否启用分类筛选,
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'UC_UA',
|
'User-Agent': 'UC_UA',
|
||||||
}, // class_parse:'.fed-pops-navbar&&ul.fed-part-rows&&a.fed-part-eone:gt(0):lt(5);a&&Text;a&&href;.*/(.*?).html',
|
},
|
||||||
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
|
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
||||||
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": "h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text",
|
title: 'h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text',
|
||||||
"img": ".fed-list-info&&a&&data-original",
|
img: '.fed-list-info&&a&&data-original',
|
||||||
"desc": ".fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text",
|
desc: '.fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text',
|
||||||
"content": ".fed-part-esan&&Text",
|
content: '.fed-part-esan&&Text',
|
||||||
"tabs": ".fed-drop-boxs&&.fed-part-rows&&li",
|
tabs: '.fed-drop-boxs&&.fed-part-rows&&li',
|
||||||
"lists": ".fed-play-item:eq(#id)&&ul:eq(1)&&li"
|
lists: '.fed-play-item:eq(#id)&&ul:eq(1)&&li',
|
||||||
},
|
},
|
||||||
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
|
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
|
||||||
},
|
},
|
||||||
@ -223,24 +269,25 @@ function getMubans() {
|
|||||||
searchUrl: '/v_search/**----------fypage---.html',
|
searchUrl: '/v_search/**----------fypage---.html',
|
||||||
url: '/vod_____show/fyclass--------fypage---.html',
|
url: '/vod_____show/fyclass--------fypage---.html',
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'MOBILE_UA'
|
'User-Agent': 'MOBILE_UA',
|
||||||
},
|
},
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
|
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
|
||||||
cate_exclude: '明星|专题|最新|排行',
|
cate_exclude: '明星|专题|最新|排行',
|
||||||
limit: 40,
|
limit: 40,
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
|
||||||
double: true,
|
double: true,
|
||||||
|
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||||
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": ".hl-infos-title&&Text;.hl-text-conch&&Text",
|
title: '.hl-dc-title&&Text;.hl-dc-content&&li:eq(6)&&Text',
|
||||||
"img": ".hl-lazy&&data-original",
|
img: '.hl-lazy&&data-original',
|
||||||
"desc": ".hl-infos-content&&.hl-text-conch&&Text",
|
desc: '.hl-dc-content&&li:eq(10)&&Text;.hl-dc-content&&li:eq(4)&&Text;.hl-dc-content&&li:eq(5)&&Text;.hl-dc-content&&li:eq(2)&&Text;.hl-dc-content&&li:eq(3)&&Text',
|
||||||
"content": ".hl-content-text&&Text",
|
content: '.hl-content-text&&Text',
|
||||||
"tabs": ".hl-tabs&&a",
|
tabs: '.hl-tabs&&a',
|
||||||
"lists": ".hl-plays-list:eq(#id)&&li"
|
tab_text: 'a--span&&Text',
|
||||||
|
lists: '.hl-plays-list:eq(#id)&&li',
|
||||||
},
|
},
|
||||||
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||||
searchable: 2, //是否启用全局搜索,
|
searchable: 2, //是否启用全局搜索,
|
||||||
@ -253,23 +300,23 @@ function getMubans() {
|
|||||||
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
|
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
|
||||||
url: '/index.php/vod/show/id/fyclass/page/fypage/',
|
url: '/index.php/vod/show/id/fyclass/page/fypage/',
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'MOBILE_UA'
|
'User-Agent': 'MOBILE_UA',
|
||||||
},
|
},
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
|
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
|
||||||
limit: 40,
|
limit: 40,
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
|
|
||||||
double: true,
|
double: true,
|
||||||
|
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
|
||||||
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
|
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": "h2&&Text;.deployment&&Text",
|
title: 'h2&&Text;.deployment&&Text',
|
||||||
"img": ".lazy&&data-original",
|
img: '.lazy&&data-original',
|
||||||
"desc": ".deployment&&Text",
|
desc: '.deployment&&Text',
|
||||||
"content": ".ec-show&&Text",
|
content: '.ec-show&&Text',
|
||||||
"tabs": "#tag&&a",
|
tabs: '#tag&&a',
|
||||||
"lists": ".play_list_box:eq(#id)&&li"
|
lists: '.play_list_box:eq(#id)&&li',
|
||||||
},
|
},
|
||||||
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
|
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
|
||||||
searchable: 2, //是否启用全局搜索,
|
searchable: 2, //是否启用全局搜索,
|
||||||
@ -290,18 +337,18 @@ function getMubans() {
|
|||||||
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
|
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
|
||||||
cate_exclude: '解析|动态',
|
cate_exclude: '解析|动态',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
|
||||||
double: true, // 推荐内容是否双层定位
|
double: true, // 推荐内容是否双层定位
|
||||||
|
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
||||||
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
||||||
二级: {
|
二级: {
|
||||||
"title": "h1&&Text;.content-rt&&p:eq(0)&&Text",
|
title: 'h1&&Text;.content-rt&&p:eq(0)&&Text',
|
||||||
"img": ".img&&img&&data-src",
|
img: '.img&&img&&data-src',
|
||||||
"desc": ".content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text",
|
desc: '.content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text',
|
||||||
"content": ".zkjj_a&&Text",
|
content: '.zkjj_a&&Text',
|
||||||
"tabs": ".py-tabs&&option",
|
tabs: '.py-tabs&&option',
|
||||||
"lists": ".player:eq(#id) li"
|
lists: '.player:eq(#id) li',
|
||||||
},
|
},
|
||||||
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
|
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
|
||||||
},
|
},
|
||||||
@ -323,18 +370,18 @@ function getMubans() {
|
|||||||
filter_def: {},
|
filter_def: {},
|
||||||
detailUrl: '/index.php/vod/detail/id/fyid.html',
|
detailUrl: '/index.php/vod/detail/id/fyid.html',
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
lazy: '',
|
lazy: common_lazy,
|
||||||
limit: 6,
|
limit: 6,
|
||||||
推荐: '.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
|
推荐: '.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
|
||||||
一级: 'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
|
一级: 'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
|
||||||
二级: {
|
二级: {
|
||||||
"title": ".slide-info-title&&Text;.slide-info:eq(3)--strong&&Text",
|
title: '.slide-info-title&&Text;.slide-info:eq(2)--strong&&Text',
|
||||||
"img": ".detail-pic&&data-original",
|
img: '.detail-pic&&data-original',
|
||||||
"desc": ".fraction&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(2)--strong&&Text;.slide-info:eq(1)--strong&&Text",
|
desc: '.slide-info-remarks&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(1)--strong&&Text;.info-parameter&&ul&&li:eq(3)&&Text',
|
||||||
"content": "#height_limit&&Text",
|
content: '#height_limit&&Text',
|
||||||
"tabs": ".anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a",
|
tabs: '.anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a',
|
||||||
"tab_text": ".swiper-slide&&Text",
|
tab_text: 'a--span&&Text',
|
||||||
"lists": ".anthology-list-box:eq(#id) li"
|
lists: '.anthology-list-box:eq(#id) li',
|
||||||
},
|
},
|
||||||
搜索: 'json:list;name;pic;;id',
|
搜索: 'json:list;name;pic;;id',
|
||||||
},
|
},
|
||||||
@ -360,19 +407,7 @@ function getMubans() {
|
|||||||
filterable: 0, //是否启用分类筛选,
|
filterable: 0, //是否启用分类筛选,
|
||||||
play_parse: true,
|
play_parse: true,
|
||||||
parse_url: '',
|
parse_url: '',
|
||||||
lazy: `js:
|
lazy: cj_lazy,
|
||||||
if(/\\.(m3u8|mp4)/.test(input)){
|
|
||||||
input = {parse:0,url:input}
|
|
||||||
}else{
|
|
||||||
if(rule.parse_url.startsWith('json:')){
|
|
||||||
let purl = rule.parse_url.replace('json:','')+input;
|
|
||||||
let html = request(purl);
|
|
||||||
input = {parse:0,url:JSON.parse(html).url}
|
|
||||||
}else{
|
|
||||||
input= rule.parse_url+input;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
推荐: '*',
|
推荐: '*',
|
||||||
一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
|
一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
|
||||||
二级: `js:
|
二级: `js:
|
||||||
@ -381,14 +416,13 @@ function getMubans() {
|
|||||||
let data=html.list;
|
let data=html.list;
|
||||||
VOD=data[0];`,
|
VOD=data[0];`,
|
||||||
搜索: '*',
|
搜索: '*',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
return JSON.parse(JSON.stringify(mubanDict));
|
return JSON.parse(JSON.stringify(mubanDict));
|
||||||
}
|
}
|
||||||
|
|
||||||
var mubanDict = getMubans();
|
var mubanDict = getMubans();
|
||||||
var muban = getMubans();
|
var muban = getMubans();
|
||||||
export
|
export default {
|
||||||
default {
|
|
||||||
muban, getMubans
|
muban, getMubans
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user