提交 1ef5ebed 编写于 作者: H hjdhnx

增加了解析加密功能

上级 4825ba47
...@@ -48,6 +48,11 @@ def 重定向(url:str): ...@@ -48,6 +48,11 @@ def 重定向(url:str):
else: else:
return str(url) return str(url)
def toast(url:str):
if isinstance(url, PyJsString):
url = parseText(str(url))
return f'toast://{url}'
@parse.route('/api/<path:filename>') @parse.route('/api/<path:filename>')
def parse_home(filename): def parse_home(filename):
url = getParmas('url') url = getParmas('url')
...@@ -61,14 +66,17 @@ def parse_home(filename): ...@@ -61,14 +66,17 @@ def parse_home(filename):
return R.failed(f'{file_path}文件不存在') return R.failed(f'{file_path}文件不存在')
logger.info(f'开始尝试通过{filename}解析:{url}') logger.info(f'开始尝试通过{filename}解析:{url}')
jsp = jsoup(url) jsp = jsoup(url)
py_ctx.update({ py_ctx.update({
'vipUrl': url, 'vipUrl': url,
'fetch_params': {'headers': {'Referer':url}, 'timeout': 10, 'encoding': 'utf-8'}, 'fetch_params': {'headers': {'Referer':url}, 'timeout': 10, 'encoding': 'utf-8'},
'jsp':jsp, 'jsp':jsp,
'重定向':重定向 '重定向':重定向,
'toast':toast,
'print':print,
'log':logger.info,
'getParmas':getParmas,
'params':getParmas()
}) })
ctx = py_ctx ctx = py_ctx
with open(file_path,encoding='utf-8') as f: with open(file_path,encoding='utf-8') as f:
...@@ -88,6 +96,8 @@ def parse_home(filename): ...@@ -88,6 +96,8 @@ def parse_home(filename):
# print(realUrl) # print(realUrl)
if str(realUrl).startswith('redirect://'): if str(realUrl).startswith('redirect://'):
return redirect(realUrl.split('redirect://')[1]) return redirect(realUrl.split('redirect://')[1])
elif str(realUrl).startswith('toast://'):
return R.failed(str(realUrl).split('toast://')[1],extra={'from':url})
return R.success(f'{filename}解析成功',realUrl,{'time':f'{get_interval(t1)}毫秒','from':url}) return R.success(f'{filename}解析成功',realUrl,{'time':f'{get_interval(t1)}毫秒','from':url})
except Exception as e: except Exception as e:
msg = f'{filename}解析出错:{e}' msg = f'{filename}解析出错:{e}'
......
let PWD = 'drpy';
// log(params);
if(!params.passwd){
realUrl = vipUrl
} else if(params.passwd !== PWD){
realUrl = toast(vipUrl+' 解析失败。解析密码错误');
}else{
realUrl = 重定向('http://211.99.99.236:4567/jhjson/ceshi.php?url='+vipUrl)
}
\ No newline at end of file
3.8.4 3.8.5
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册