Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
季末490
dr_py
提交
a5dc3eff
dr_py
项目概览
季末490
/
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,发现更多精彩内容 >>
提交
a5dc3eff
编写于
10月 03, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改模板.js兼容性
上级
dc04952d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
8 deletion
+11
-8
controllers/admin.py
controllers/admin.py
+5
-2
controllers/cms.py
controllers/cms.py
+1
-1
controllers/vod.py
controllers/vod.py
+4
-4
js/rules.py
js/rules.py
+1
-1
未找到文件。
controllers/admin.py
浏览文件 @
a5dc3eff
...
...
@@ -38,8 +38,11 @@ def admin_index(): # 管理员界面
live_url
=
lsg
.
getItem
(
'LIVE_URL'
)
use_py
=
lsg
.
getItem
(
'USE_PY'
)
# print(f'live_url:', live_url)
rules
=
getRules
(
'js'
)
# print(rules)
cache_count
=
getCacheCount
()
return
render_template
(
'admin.html'
,
pystate
=
use_py
,
rules
=
getRules
(
'js'
),
cache_count
=
cache_count
,
ver
=
getLocalVer
(),
live_url
=
live_url
)
# print(cache_count)
return
render_template
(
'admin.html'
,
pystate
=
use_py
,
rules
=
rules
,
cache_count
=
cache_count
,
ver
=
getLocalVer
(),
live_url
=
live_url
)
@
admin
.
route
(
'/settings'
)
def
admin_settings
():
# 管理员界面
...
...
@@ -214,7 +217,7 @@ def upload_file():
if
os
.
path
.
exists
(
savePath
):
return
R
.
failed
(
f
'上传失败,文件已存在,请先查看删除再试'
)
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f2
:
before
=
f2
.
read
()
before
=
f2
.
read
()
.
split
(
'export'
)[
0
]
upcode
=
file
.
stream
.
read
().
decode
(
'utf-8'
)
check_to_run
=
before
+
upcode
# print(check_to_run)
...
...
controllers/cms.py
浏览文件 @
a5dc3eff
...
...
@@ -1245,7 +1245,7 @@ if __name__ == '__main__':
# js_path = f'js/玩偶姐姐.js'
# js_path = f'js/555影视.js'
with
open
(
'../js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
js_path
=
f
'js/360影视.js'
ctx
,
js_code
=
parser
.
runJs
(
js_path
,
before
=
before
)
ruleDict
=
ctx
.
rule
.
to_dict
()
...
...
controllers/vod.py
浏览文件 @
a5dc3eff
...
...
@@ -27,7 +27,7 @@ def search_one(rule, wd, before: str = ''):
t1
=
time
()
if
not
before
:
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
js_path
=
f
'js/
{
rule
}
.js'
try
:
ctx
,
js_code
=
parser
.
runJs
(
js_path
,
before
=
before
)
...
...
@@ -63,7 +63,7 @@ def multi_search2(wd):
# print(search_sites)
res
=
[]
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
logger
.
info
(
f
'聚搜准备工作耗时:
{
get_interval
(
t1
)
}
毫秒'
)
t2
=
time
()
thread_pool
=
ThreadPoolExecutor
(
len
(
search_sites
))
# 定义线程池来启动多线程执行此任务
...
...
@@ -109,7 +109,7 @@ def multi_search(wd):
# print(search_sites)
res
=
[]
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
with
ThreadPoolExecutor
(
max_workers
=
len
(
search_sites
))
as
executor
:
to_do
=
[]
for
site
in
search_sites
:
...
...
@@ -159,7 +159,7 @@ def vod_home():
# js_path = f'js/{rule}.js' if not ext.startswith('http') else ext
js_path
=
f
'js/
{
rule
}
.js'
if
not
ext
else
ext
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
# logger.info(f'js读取耗时:{get_interval(t1)}毫秒')
logger
.
info
(
f
'参数检验js读取共计耗时:
{
get_interval
(
t0
)
}
毫秒'
)
t2
=
time
()
...
...
js/rules.py
浏览文件 @
a5dc3eff
...
...
@@ -40,7 +40,7 @@ def getRules(path='cache'):
rule_list
=
[
file
.
replace
(
'.js'
,
''
)
for
file
in
file_name
]
js_path
=
[
f
'
{
path
}
/
{
rule
}
.js'
for
rule
in
rule_list
]
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
before
=
f
.
read
()
.
split
(
'export'
)[
0
]
rule_codes
=
[]
# for js in js_path:
# with open(js,encoding='utf-8') as f:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录