mirror of
https://github.com/alantang1977/hipy.git
synced 2024-11-24 15:33:11 +02:00
Add files via upload
This commit is contained in:
parent
b5b0bf61f9
commit
0808c3d343
13 changed files with 19233 additions and 0 deletions
1
drpy_libs/cheerio.min.js
vendored
Normal file
1
drpy_libs/cheerio.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6140
drpy_libs/crypto-hiker.js
Normal file
6140
drpy_libs/crypto-hiker.js
Normal file
File diff suppressed because it is too large
Load diff
6191
drpy_libs/crypto-js.js
Normal file
6191
drpy_libs/crypto-js.js
Normal file
File diff suppressed because it is too large
Load diff
3761
drpy_libs/drpy2.js
Normal file
3761
drpy_libs/drpy2.js
Normal file
File diff suppressed because one or more lines are too long
76
drpy_libs/drpy2.min.js
vendored
Normal file
76
drpy_libs/drpy2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
68
drpy_libs/gbk.js
Normal file
68
drpy_libs/gbk.js
Normal file
File diff suppressed because one or more lines are too long
577
drpy_libs/jinja.js
Normal file
577
drpy_libs/jinja.js
Normal file
|
@ -0,0 +1,577 @@
|
|||
/*!
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
1
drpy_libs/jinja.min.js
vendored
Normal file
1
drpy_libs/jinja.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
265
drpy_libs/jsencrypt.js
Normal file
265
drpy_libs/jsencrypt.js
Normal file
File diff suppressed because one or more lines are too long
1737
drpy_libs/json5.js
Normal file
1737
drpy_libs/json5.js
Normal file
File diff suppressed because one or more lines are too long
2
drpy_libs/node-rsa.js
Normal file
2
drpy_libs/node-rsa.js
Normal file
File diff suppressed because one or more lines are too long
2
drpy_libs/pako.min.js
vendored
Normal file
2
drpy_libs/pako.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
412
drpy_libs/模板.js
Normal file
412
drpy_libs/模板.js
Normal file
|
@ -0,0 +1,412 @@
|
|||
if (typeof Object.assign !== 'function') {
|
||||
Object.assign = function () {
|
||||
let target = arguments[0];
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
let source = arguments[i];
|
||||
for (let key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
}
|
||||
|
||||
// 通用免嗅探播放
|
||||
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() {
|
||||
const mubanDict = { // 模板字典
|
||||
mx: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/vodshow/fyclass--------fypage---/',
|
||||
searchUrl: '/vodsearch/**----------fypage---/',
|
||||
class_parse: '.top_nav li;a&&Text;a&&href;.*/(.*?)/',
|
||||
searchable: 2,
|
||||
quickSearch: 0,
|
||||
filterable: 0,
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
},
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
double: true,
|
||||
推荐: '.cbox_list;*;*;*;*;*',
|
||||
一级: 'ul.vodlist li;a&&title;a&&data-original;.pic_text&&Text;a&&href',
|
||||
二级: {
|
||||
title: 'h2&&Text;.content_detail:eq(1)&&li&&a:eq(2)&&Text',
|
||||
img: '.vodlist_thumb&&data-original',
|
||||
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',
|
||||
tabs: '.play_source_tab&&a',
|
||||
lists: '.content_playlist:eq(#id) li',
|
||||
},
|
||||
搜索: '*',
|
||||
},
|
||||
mxpro: {
|
||||
title: '',
|
||||
host: '', // homeUrl:'/',
|
||||
url: '/vodshow/fyclass--------fypage---.html',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.navbar-items li:gt(0):lt(10);a&&Text;a&&href;/(\\d+)',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: 'h1&&Text;.module-info-tag-link:eq(-1)&&Text',
|
||||
img: '.lazyload&&data-original||data-src||src',
|
||||
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',
|
||||
tabs: '.module-tab-item',
|
||||
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',
|
||||
}, mxone5: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/show/fyclass--------fypage---.html',
|
||||
searchUrl: '/search/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?)\.html',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: 'h1&&Text;.tag-link&&Text',
|
||||
img: '.module-item-pic&&img&&data-src',
|
||||
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',
|
||||
tabs: '.module-tab-item',
|
||||
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',
|
||||
}, 首图: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/vodshow/fyclass--------fypage---/',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: '.myui-content__detail .title--span&&Text;.myui-content__detail p.data:eq(3)&&Text',
|
||||
img: '.myui-content__thumb .lazyload&&data-original',
|
||||
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',
|
||||
tabs: '.myui-panel__head&&li',
|
||||
// tabs: '.nav-tabs&&li',
|
||||
lists: '.myui-content__list:eq(#id) li',
|
||||
},
|
||||
搜索: '#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
|
||||
}, 首图2: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/list/fyclass-fypage.html',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {
|
||||
'User-Agent': 'UC_UA', // "Cookie": ""
|
||||
},
|
||||
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: '.stui-content__detail .title&&Text;.stui-content__detail&&p:eq(-2)&&a&&Text',
|
||||
title1: '.stui-content__detail .title&&Text;.stui-content__detail&&p&&Text',
|
||||
img: '.stui-content__thumb .lazyload&&data-original',
|
||||
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',
|
||||
desc1: '.stui-content__detail p:eq(4)&&Text;;;.stui-content__detail p:eq(1)&&Text',
|
||||
content: '.detail&&Text',
|
||||
tabs: '.stui-pannel__head h3',
|
||||
tabs1: '.stui-vodlist__head h3',
|
||||
lists: '.stui-content__playlist:eq(#id) li',
|
||||
},
|
||||
搜索: 'ul.stui-vodlist__media,ul.stui-vodlist,#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
|
||||
}, 默认: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '',
|
||||
searchUrl: '',
|
||||
searchable: 2,
|
||||
quickSearch: 0,
|
||||
filterable: 0,
|
||||
filter: '',
|
||||
filter_url: '',
|
||||
filter_def: {},
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
},
|
||||
timeout: 5000,
|
||||
class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
|
||||
cate_exclude: '',
|
||||
play_parse: true,
|
||||
lazy: def_lazy,
|
||||
double: true,
|
||||
推荐: '列表1;列表2;标题;图片;描述;链接;详情',
|
||||
一级: '列表;标题;图片;描述;链接;详情',
|
||||
二级: {
|
||||
title: 'vod_name;vod_type',
|
||||
img: '图片链接',
|
||||
desc: '主要信息;年代;地区;演员;导演',
|
||||
content: '简介',
|
||||
tabs: '',
|
||||
lists: 'xx:eq(#id)&&a',
|
||||
tab_text: 'body&&Text',
|
||||
list_text: 'body&&Text',
|
||||
list_url: 'a&&href',
|
||||
},
|
||||
搜索: '列表;标题;图片;描述;链接;详情',
|
||||
}, vfed: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/index.php/vod/show/id/fyclass/page/fypage.html',
|
||||
searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {
|
||||
'User-Agent': 'UC_UA',
|
||||
},
|
||||
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: 'h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text',
|
||||
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',
|
||||
content: '.fed-part-esan&&Text',
|
||||
tabs: '.fed-drop-boxs&&.fed-part-rows&&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',
|
||||
}, 海螺3: {
|
||||
title: '',
|
||||
host: '',
|
||||
searchUrl: '/v_search/**----------fypage---.html',
|
||||
url: '/vod_____show/fyclass--------fypage---.html',
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
},
|
||||
timeout: 5000,
|
||||
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
|
||||
cate_exclude: '明星|专题|最新|排行',
|
||||
limit: 40,
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
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',
|
||||
二级: {
|
||||
title: '.hl-dc-title&&Text;.hl-dc-content&&li:eq(6)&&Text',
|
||||
img: '.hl-lazy&&data-original',
|
||||
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',
|
||||
tabs: '.hl-tabs&&a',
|
||||
tab_text: 'a--span&&Text',
|
||||
lists: '.hl-plays-list:eq(#id)&&li',
|
||||
},
|
||||
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
}, 海螺2: {
|
||||
title: '',
|
||||
host: '',
|
||||
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
|
||||
url: '/index.php/vod/show/id/fyclass/page/fypage/',
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
},
|
||||
timeout: 5000,
|
||||
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
|
||||
limit: 40,
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
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',
|
||||
二级: {
|
||||
title: 'h2&&Text;.deployment&&Text',
|
||||
img: '.lazy&&data-original',
|
||||
desc: '.deployment&&Text',
|
||||
content: '.ec-show&&Text',
|
||||
tabs: '#tag&&a',
|
||||
lists: '.play_list_box:eq(#id)&&li',
|
||||
},
|
||||
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
}, 短视: {
|
||||
title: '',
|
||||
host: '', // homeUrl:'/',
|
||||
url: '/channel/fyclass-fypage.html',
|
||||
searchUrl: '/search.html?wd=**',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
|
||||
cate_exclude: '解析|动态',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
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',
|
||||
二级: {
|
||||
title: 'h1&&Text;.content-rt&&p:eq(0)&&Text',
|
||||
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',
|
||||
content: '.zkjj_a&&Text',
|
||||
tabs: '.py-tabs&&option',
|
||||
lists: '.player:eq(#id) li',
|
||||
},
|
||||
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
|
||||
}, 短视2: {
|
||||
title: '',
|
||||
host: '',
|
||||
class_name: '电影&电视剧&综艺&动漫',
|
||||
class_url: '1&2&3&4',
|
||||
searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
|
||||
searchable: 2,
|
||||
quickSearch: 0,
|
||||
headers: {'User-Agent': 'MOBILE_UA'},
|
||||
url: '/index.php/api/vod#type=fyclass&page=fypage',
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
filter_url: '',
|
||||
filter: {},
|
||||
filter_def: {},
|
||||
detailUrl: '/index.php/vod/detail/id/fyid.html',
|
||||
play_parse: true,
|
||||
lazy: common_lazy,
|
||||
limit: 6,
|
||||
推荐: '.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});',
|
||||
二级: {
|
||||
title: '.slide-info-title&&Text;.slide-info:eq(2)--strong&&Text',
|
||||
img: '.detail-pic&&data-original',
|
||||
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',
|
||||
tabs: '.anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a',
|
||||
tab_text: 'a--span&&Text',
|
||||
lists: '.anthology-list-box:eq(#id) li',
|
||||
},
|
||||
搜索: 'json:list;name;pic;;id',
|
||||
}, 采集1: {
|
||||
title: '',
|
||||
host: '',
|
||||
homeTid: '13',
|
||||
homeUrl: '/api.php/provide/vod/?ac=detail&t={{rule.homeTid}}',
|
||||
detailUrl: '/api.php/provide/vod/?ac=detail&ids=fyid',
|
||||
searchUrl: '/api.php/provide/vod/?wd=**&pg=fypage',
|
||||
url: '/api.php/provide/vod/?ac=detail&pg=fypage&t=fyclass',
|
||||
headers: {'User-Agent': 'MOBILE_UA'},
|
||||
timeout: 5000, // class_name: '电影&电视剧&综艺&动漫',
|
||||
// class_url: '1&2&3&4',
|
||||
// class_parse:'js:let html=request(input);input=JSON.parse(html).class;',
|
||||
class_parse: 'json:class;',
|
||||
limit: 20,
|
||||
multi: 1,
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 1,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
play_parse: true,
|
||||
parse_url: '',
|
||||
lazy: cj_lazy,
|
||||
推荐: '*',
|
||||
一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
|
||||
二级: `js:
|
||||
let html=request(input);
|
||||
html=JSON.parse(html);
|
||||
let data=html.list;
|
||||
VOD=data[0];`,
|
||||
搜索: '*',
|
||||
},
|
||||
};
|
||||
return JSON.parse(JSON.stringify(mubanDict));
|
||||
}
|
||||
|
||||
var mubanDict = getMubans();
|
||||
var muban = getMubans();
|
||||
export default {muban, getMubans};
|
Loading…
Reference in a new issue