js1增加本地代理接口proxy函数
This commit is contained in:
parent
c5b3638a83
commit
711776ac65
10
doc/写源教程.md
10
doc/写源教程.md
@ -90,6 +90,11 @@ var rule = {
|
||||
二级:'*',
|
||||
// 搜索可以是*,集成一级,或者跟一级一样的写法 列表;标题;图片;描述;链接;详情
|
||||
搜索:'*',
|
||||
// 本地代理规则,可用于修改m3u8文件文本去广告后返回代理文件地址,也可以代理加密图片
|
||||
proxy_rule:`js:
|
||||
log(input);
|
||||
input = [200,'text;plain','hello drpy']
|
||||
`
|
||||
}
|
||||
```
|
||||
模板继承写法
|
||||
@ -125,3 +130,8 @@ class_parse:`.navbar-items li:gt(1):lt(7);a&&Text;a&&href;/(\\d+).html`,
|
||||
|
||||
js:内置变量
|
||||
input,html,VODS,VOD,TABS,LISTS,MY_CATE,MY_FL
|
||||
getProxyUrl(获取壳子本地代理地址返回 /proxy?do=js的完整链接)
|
||||
|
||||
本地代理说明:
|
||||
proxy_rule参数input赋值格式为三元素列表[status,content-type,data]
|
||||
如: [200,'text/plain','hello drpy']
|
||||
@ -437,8 +437,8 @@ function getCryptoJS(){
|
||||
* @returns {string|*}
|
||||
*/
|
||||
function getProxyUrl(){
|
||||
if(typeof(getProxy)==='function'){
|
||||
return getProxy()
|
||||
if(typeof(getProxy)==='function'){//判断壳子里有getProxy函数就执行取返回结果。否则取默认的本地
|
||||
return getProxy(true)
|
||||
}else{
|
||||
return 'http://127.0.0.1:9978/proxy?do=js'
|
||||
}
|
||||
@ -2126,7 +2126,7 @@ function proxyParse(proxyObj){
|
||||
if(proxyObj.proxy_rule){
|
||||
try {
|
||||
eval(proxyObj.proxy_rule);
|
||||
if(input && input!== proxyObj.params && Array.isArray(input)){
|
||||
if(input && input!== proxyObj.params && Array.isArray(input) &&input.length===3){
|
||||
return input
|
||||
}else{
|
||||
return [404,'text/plain','Not Found']
|
||||
|
||||
2
libs/drpy.min.js
vendored
2
libs/drpy.min.js
vendored
File diff suppressed because one or more lines are too long
@ -426,8 +426,8 @@ function getCryptoJS(){
|
||||
* @returns {string|*}
|
||||
*/
|
||||
function getProxyUrl(){
|
||||
if(typeof(getProxy)==='function'){
|
||||
return getProxy()
|
||||
if(typeof(getProxy)==='function'){//判断壳子里有getProxy函数就执行取返回结果。否则取默认的本地
|
||||
return getProxy(true)
|
||||
}else{
|
||||
return 'http://127.0.0.1:9978/proxy?do=js'
|
||||
}
|
||||
@ -1990,7 +1990,7 @@ function proxyParse(proxyObj){
|
||||
if(proxyObj.proxy_rule){
|
||||
try {
|
||||
eval(proxyObj.proxy_rule);
|
||||
if(input && input!== proxyObj.params && Array.isArray(input)){
|
||||
if(input && input!== proxyObj.params && Array.isArray(input) &&input.length===3){
|
||||
return input
|
||||
}else{
|
||||
return [404,'text/plain','Not Found']
|
||||
|
||||
2
libs/drpy2.min.js
vendored
2
libs/drpy2.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user