提交 62d0401b 编写于 作者: H hjdhnx

优化了自动配置装载耗时

上级 8ef49c8b
...@@ -234,9 +234,23 @@ def getRules(path='cache'): ...@@ -234,9 +234,23 @@ def getRules(path='cache'):
with open('js/模板.js', encoding='utf-8') as f: with open('js/模板.js', encoding='utf-8') as f:
before = f.read() before = f.read()
rule_codes = [] rule_codes = []
for js in js_path: # for js in js_path:
# with open(js,encoding='utf-8') as f:
# code = f.read()
# rule_codes.append(js2py.eval_js(before+code))
ctx = js2py.EvalJs()
codes = []
for i in range(len(js_path)):
js = js_path[i]
with open(js,encoding='utf-8') as f: with open(js,encoding='utf-8') as f:
rule_codes.append(js2py.eval_js(before+f.read())) code = f.read()
codes.append(code.replace('rule',f'rule{i}',1))
newCodes = before + '\n'+ '\n'.join(codes)
# print(newCodes)
ctx.execute(newCodes)
for i in range(len(js_path)):
rule_codes.append(ctx.eval(f'rule{i}'))
# print(rule_codes) # print(rule_codes)
# print(type(rule_codes[0]),rule_codes[0]) # print(type(rule_codes[0]),rule_codes[0])
......
{ {
"wallpaper": "http://localhost:5705/pics", "wallpaper": "http://localhost:5705/pics",
"dr_count": 11, "dr_count": 16,
"mode": 0, "mode": 0,
"sites": [ "sites": [
{ {
...@@ -17,8 +17,26 @@ ...@@ -17,8 +17,26 @@
"name": "cokemv(道长)", "name": "cokemv(道长)",
"type": 1, "type": 1,
"api": "http://localhost:5705/vod?rule=cokemv", "api": "http://localhost:5705/vod?rule=cokemv",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_LIBVIO",
"name": "LIBVIO(道长)",
"type": 1,
"api": "http://localhost:5705/vod?rule=LIBVIO",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{
"key": "dr_万能影视",
"name": "万能影视(道长)",
"type": 1,
"api": "http://localhost:5705/vod?rule=万能影视",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -30,13 +48,22 @@ ...@@ -30,13 +48,22 @@
"quickSearch": 1, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_在线之家",
"name": "在线之家(道长)",
"type": 1,
"api": "http://localhost:5705/vod?rule=在线之家",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_夜空", "key": "dr_夜空",
"name": "夜空(道长)", "name": "夜空(道长)",
"type": 1, "type": 1,
"api": "http://localhost:5705/vod?rule=夜空", "api": "http://localhost:5705/vod?rule=夜空",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -48,6 +75,15 @@ ...@@ -48,6 +75,15 @@
"quickSearch": 0, "quickSearch": 0,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_影视工厂",
"name": "影视工厂(道长)",
"type": 1,
"api": "http://localhost:5705/vod?rule=影视工厂",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_玩偶姐姐", "key": "dr_玩偶姐姐",
"name": "玩偶姐姐(道长)", "name": "玩偶姐姐(道长)",
...@@ -71,8 +107,8 @@ ...@@ -71,8 +107,8 @@
"name": "看视界(道长)", "name": "看视界(道长)",
"type": 1, "type": 1,
"api": "http://localhost:5705/vod?rule=看视界", "api": "http://localhost:5705/vod?rule=看视界",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -80,8 +116,17 @@ ...@@ -80,8 +116,17 @@
"name": "莫扎兔(道长)", "name": "莫扎兔(道长)",
"type": 1, "type": 1,
"api": "http://localhost:5705/vod?rule=莫扎兔", "api": "http://localhost:5705/vod?rule=莫扎兔",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_蓝光影院",
"name": "蓝光影院(道长)",
"type": 1,
"api": "http://localhost:5705/vod?rule=蓝光影院",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -98,8 +143,8 @@ ...@@ -98,8 +143,8 @@
"name": "鸭奈飞(道长)", "name": "鸭奈飞(道长)",
"type": 1, "type": 1,
"api": "http://localhost:5705/vod?rule=鸭奈飞", "api": "http://localhost:5705/vod?rule=鸭奈飞",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
} }
], ],
......
{ {
"wallpaper": "http://192.168.10.99:5705/pics", "wallpaper": "http://192.168.10.99:5705/pics",
"dr_count": 11, "dr_count": 16,
"mode": 1, "mode": 1,
"sites": [ "sites": [
{ {
...@@ -17,8 +17,26 @@ ...@@ -17,8 +17,26 @@
"name": "cokemv(道长)", "name": "cokemv(道长)",
"type": 1, "type": 1,
"api": "http://192.168.10.99:5705/vod?rule=cokemv", "api": "http://192.168.10.99:5705/vod?rule=cokemv",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_LIBVIO",
"name": "LIBVIO(道长)",
"type": 1,
"api": "http://192.168.10.99:5705/vod?rule=LIBVIO",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{
"key": "dr_万能影视",
"name": "万能影视(道长)",
"type": 1,
"api": "http://192.168.10.99:5705/vod?rule=万能影视",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -30,13 +48,22 @@ ...@@ -30,13 +48,22 @@
"quickSearch": 1, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_在线之家",
"name": "在线之家(道长)",
"type": 1,
"api": "http://192.168.10.99:5705/vod?rule=在线之家",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_夜空", "key": "dr_夜空",
"name": "夜空(道长)", "name": "夜空(道长)",
"type": 1, "type": 1,
"api": "http://192.168.10.99:5705/vod?rule=夜空", "api": "http://192.168.10.99:5705/vod?rule=夜空",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -48,6 +75,15 @@ ...@@ -48,6 +75,15 @@
"quickSearch": 0, "quickSearch": 0,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_影视工厂",
"name": "影视工厂(道长)",
"type": 1,
"api": "http://192.168.10.99:5705/vod?rule=影视工厂",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_玩偶姐姐", "key": "dr_玩偶姐姐",
"name": "玩偶姐姐(道长)", "name": "玩偶姐姐(道长)",
...@@ -71,8 +107,8 @@ ...@@ -71,8 +107,8 @@
"name": "看视界(道长)", "name": "看视界(道长)",
"type": 1, "type": 1,
"api": "http://192.168.10.99:5705/vod?rule=看视界", "api": "http://192.168.10.99:5705/vod?rule=看视界",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -80,8 +116,17 @@ ...@@ -80,8 +116,17 @@
"name": "莫扎兔(道长)", "name": "莫扎兔(道长)",
"type": 1, "type": 1,
"api": "http://192.168.10.99:5705/vod?rule=莫扎兔", "api": "http://192.168.10.99:5705/vod?rule=莫扎兔",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_蓝光影院",
"name": "蓝光影院(道长)",
"type": 1,
"api": "http://192.168.10.99:5705/vod?rule=蓝光影院",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -98,8 +143,8 @@ ...@@ -98,8 +143,8 @@
"name": "鸭奈飞(道长)", "name": "鸭奈飞(道长)",
"type": 1, "type": 1,
"api": "http://192.168.10.99:5705/vod?rule=鸭奈飞", "api": "http://192.168.10.99:5705/vod?rule=鸭奈飞",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
} }
], ],
......
{ {
"wallpaper": "http://cms.nokia.press/pics", "wallpaper": "http://cms.nokia.press/pics",
"dr_count": 11, "dr_count": 16,
"mode": 1, "mode": 1,
"sites": [ "sites": [
{ {
...@@ -17,8 +17,26 @@ ...@@ -17,8 +17,26 @@
"name": "cokemv(道长)", "name": "cokemv(道长)",
"type": 1, "type": 1,
"api": "http://cms.nokia.press/vod?rule=cokemv", "api": "http://cms.nokia.press/vod?rule=cokemv",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_LIBVIO",
"name": "LIBVIO(道长)",
"type": 1,
"api": "http://cms.nokia.press/vod?rule=LIBVIO",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{
"key": "dr_万能影视",
"name": "万能影视(道长)",
"type": 1,
"api": "http://cms.nokia.press/vod?rule=万能影视",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -30,13 +48,22 @@ ...@@ -30,13 +48,22 @@
"quickSearch": 1, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_在线之家",
"name": "在线之家(道长)",
"type": 1,
"api": "http://cms.nokia.press/vod?rule=在线之家",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_夜空", "key": "dr_夜空",
"name": "夜空(道长)", "name": "夜空(道长)",
"type": 1, "type": 1,
"api": "http://cms.nokia.press/vod?rule=夜空", "api": "http://cms.nokia.press/vod?rule=夜空",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -48,6 +75,15 @@ ...@@ -48,6 +75,15 @@
"quickSearch": 0, "quickSearch": 0,
"filterable": 0 "filterable": 0
}, },
{
"key": "dr_影视工厂",
"name": "影视工厂(道长)",
"type": 1,
"api": "http://cms.nokia.press/vod?rule=影视工厂",
"searchable": 1,
"quickSearch": 1,
"filterable": 0
},
{ {
"key": "dr_玩偶姐姐", "key": "dr_玩偶姐姐",
"name": "玩偶姐姐(道长)", "name": "玩偶姐姐(道长)",
...@@ -71,8 +107,8 @@ ...@@ -71,8 +107,8 @@
"name": "看视界(道长)", "name": "看视界(道长)",
"type": 1, "type": 1,
"api": "http://cms.nokia.press/vod?rule=看视界", "api": "http://cms.nokia.press/vod?rule=看视界",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -80,8 +116,17 @@ ...@@ -80,8 +116,17 @@
"name": "莫扎兔(道长)", "name": "莫扎兔(道长)",
"type": 1, "type": 1,
"api": "http://cms.nokia.press/vod?rule=莫扎兔", "api": "http://cms.nokia.press/vod?rule=莫扎兔",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0
},
{
"key": "dr_蓝光影院",
"name": "蓝光影院(道长)",
"type": 1,
"api": "http://cms.nokia.press/vod?rule=蓝光影院",
"searchable": 1,
"quickSearch": 1,
"filterable": 0 "filterable": 0
}, },
{ {
...@@ -98,8 +143,8 @@ ...@@ -98,8 +143,8 @@
"name": "鸭奈飞(道长)", "name": "鸭奈飞(道长)",
"type": 1, "type": 1,
"api": "http://cms.nokia.press/vod?rule=鸭奈飞", "api": "http://cms.nokia.press/vod?rule=鸭奈飞",
"searchable": 0, "searchable": 1,
"quickSearch": 0, "quickSearch": 1,
"filterable": 0 "filterable": 0
} }
], ],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册