Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lsj315820
dr_py
提交
5c561982
dr_py
项目概览
lsj315820
/
dr_py
与 Fork 源项目一致
Fork自
晚风拂柳颜 / dr_py
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
dr_py
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c561982
编写于
11月 21, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化源代理逻辑
上级
0a1ad630
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
5 deletion
+11
-5
controllers/admin.py
controllers/admin.py
+2
-1
controllers/vod.py
controllers/vod.py
+4
-1
js/007影视.js
js/007影视.js
+1
-1
utils/env.py
utils/env.py
+2
-1
utils/parser.py
utils/parser.py
+2
-1
未找到文件。
controllers/admin.py
浏览文件 @
5c561982
...
...
@@ -88,7 +88,8 @@ def admin_view_rule(name):
rurl
=
burl
.
replace
(
oldsrc
,
newsrc
)
if
burl
!=
rurl
:
jscode
=
parser
.
getJs
(
name
,
'js'
)
rjscode
=
render_template_string
(
jscode
,
env
=
env
)
# rjscode = render_template_string(jscode, env=env)
rjscode
=
render_template_string
(
jscode
,
**
env
)
if
rjscode
.
strip
()
==
jscode
.
strip
():
# 无需渲染才代理
return
redirect
(
rurl
)
else
:
...
...
controllers/vod.py
浏览文件 @
5c561982
...
...
@@ -57,6 +57,9 @@ def search_one(rule, wd, before: str = ''):
try
:
with
open
(
js_path
,
encoding
=
'utf-8'
)
as
f2
:
jscode
=
f2
.
read
()
env
=
get_env
()
if
env
:
jscode
=
render_template_string
(
jscode
,
**
env
)
jscode
=
before
+
jscode
+
end_code
# print(jscode)
ctx
.
eval
(
jscode
)
...
...
@@ -240,7 +243,7 @@ def vod_home():
jscode
=
f2
.
read
()
env
=
get_env
()
if
env
:
jscode
=
render_template_string
(
jscode
,
env
=
env
)
jscode
=
render_template_string
(
jscode
,
**
env
)
# print(jscode)
jscode
=
before
+
jscode
+
end_code
# print(jscode)
...
...
js/007影视.js
浏览文件 @
5c561982
muban
.
首图2
.
二级
.
tabs
=
'
.nav-tabs.dpplay&&li
'
;
var
rule
=
Object
.
assign
(
muban
.
首图2
,{
title
:
'
007影视
'
,
ali_token
:
'
{{
env.
ali_token}}
'
,
ali_token
:
'
{{ali_token}}
'
,
host
:
'
https://www.007ts.me
'
,
url
:
'
/channel/fyclass-fypage.html
'
,
searchUrl
:
'
/search/**----------fypage---.html
'
,
...
...
utils/env.py
浏览文件 @
5c561982
...
...
@@ -15,6 +15,7 @@ def get_env():
# print(new_conf)
env
=
{
'ali_token'
:
new_conf
.
ALI_TOKEN
,
'js_proxy'
:
new_conf
.
JS_PROXY
'js_proxy'
:
new_conf
.
JS_PROXY
,
'fl'
:
'{{fl}}'
# 防止被依赖代理
}
return
env
\ No newline at end of file
utils/parser.py
浏览文件 @
5c561982
...
...
@@ -86,7 +86,8 @@ def toJs(jsPath,jsRoot='cache',env=None):
with
open
(
js_path
,
'r'
,
encoding
=
'UTF-8'
)
as
fp
:
js
=
fp
.
read
()
if
env
:
js
=
render_template_string
(
js
,
env
=
env
)
# js = render_template_string(js,env=env)
js
=
render_template_string
(
js
,
**
env
)
response
=
make_response
(
js
)
response
.
headers
[
'Content-Type'
]
=
'text/javascript; charset=utf-8'
return
response
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录