提交 f0e9ac68 编写于 作者: H hjdhnx

增加自建隐藏解析

上级 ab9232a2
......@@ -3,7 +3,7 @@
# File : parse.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/24
from flask import Blueprint, jsonify
from flask import Blueprint, jsonify,redirect
from utils.web import getParmas,get_interval
import os
from utils.log import logger
......@@ -37,6 +37,14 @@ class R(object):
def failed(self,msg="系统异常", code=404,extra=None):
return self.error(msg,code,extra)
def 重定向(url:str):
if isinstance(url, PyJsString):
url = parseText(str(url))
if str(url).startswith('http'):
return f'redirect://{url}'
else:
return str(url)
@parse.route('/api/<path:filename>')
def parse_home(filename):
url = getParmas('url')
......@@ -50,11 +58,14 @@ def parse_home(filename):
return R.failed(f'{file_path}文件不存在')
logger.info(f'开始尝试通过{filename}解析:{url}')
jsp = jsoup(url)
py_ctx.update({
'vipUrl': url,
'fetch_params': {'headers': {'Referer':url}, 'timeout': 10, 'encoding': 'utf-8'},
'jsp':jsp
'jsp':jsp,
'重定向':重定向
})
ctx = py_ctx
with open(file_path,encoding='utf-8') as f:
......@@ -69,6 +80,9 @@ def parse_home(filename):
return R.failed(f'解析失败:{realUrl}')
if isinstance(realUrl, PyJsString):
realUrl = parseText(str(realUrl))
# print(realUrl)
if str(realUrl).startswith('redirect://'):
return redirect(realUrl.split('redirect://')[1])
return R.success(f'{filename}解析成功',realUrl,{'time':f'{get_interval(t1)}毫秒'})
except Exception as e:
msg = f'{filename}解析出错:{e}'
......
realUrl = 重定向('http://211.99.99.236:4567/jhjson/ceshi.php?url='+vipUrl)
\ No newline at end of file
3.7.11
\ No newline at end of file
3.7.12
\ No newline at end of file
......@@ -13,7 +13,7 @@
BT5V,https://rx.bt5v.com/json/jsonindex.php/?url=,1
# 查询,https://chaxun.truechat365.com/?url= # 这个解析真的牛逼,只能电脑看
# llq,https://hc.izny.cn/json.php?url=,1
江湖,http://211.99.99.236:4567/jhjson/ceshi.php?url=,1
江湖,{{host}}/parse/api/江湖.js?url=,1
左岸,https://jx.bozrc.com:4433/player/?url=
GGTV搜集,https://play.fuqizhishi.com/juhe/API.php?appkey=caijijuhe220902&url=,1,
CY,https://vip.cyu0.cn/home/api?type=ys&uid=1353484&key=efopqwABCLOTVYZ278&url=,1
......
......@@ -50,6 +50,7 @@
- [X] 1.v3.7.10 增加了自定义解析功能,解析.conf支持变量{{host}}
- [X] 2.新增了 jiexi/无名.js作为示例,接受vipUrl返回realUrl
- [X] 3.修复腾云驾雾并增加通用筛选
- [X] 4.自建解析增加重定向方法,方便明面上隐藏真实来源的解析地址
###### 2022/09/23
- [X] 1.v3.7.5 优化了首图2模板的搜索定位以及几个相关的源
- [X] 2.二级渲染功能拆分,js单独调用
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册