From 62d0401b395261732e21b922098e725d15c2f9f5 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Wed, 31 Aug 2022 13:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A3=85=E8=BD=BD=E8=80=97=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 18 +++++++++++-- txt/pycms0.json | 67 +++++++++++++++++++++++++++++++++++++++++-------- txt/pycms1.json | 67 +++++++++++++++++++++++++++++++++++++++++-------- txt/pycms2.json | 67 +++++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 184 insertions(+), 35 deletions(-) diff --git a/app.py b/app.py index eb57ba0..60cf070 100644 --- a/app.py +++ b/app.py @@ -234,9 +234,23 @@ def getRules(path='cache'): with open('js/模板.js', encoding='utf-8') as f: before = f.read() 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: - 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(type(rule_codes[0]),rule_codes[0]) diff --git a/txt/pycms0.json b/txt/pycms0.json index 77535b1..e7533ab 100644 --- a/txt/pycms0.json +++ b/txt/pycms0.json @@ -1,6 +1,6 @@ { "wallpaper": "http://localhost:5705/pics", - "dr_count": 11, + "dr_count": 16, "mode": 0, "sites": [ { @@ -17,8 +17,26 @@ "name": "cokemv(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=cokemv", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "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 }, { @@ -30,13 +48,22 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_在线之家", + "name": "在线之家(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=在线之家", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_夜空", "name": "夜空(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=夜空", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -48,6 +75,15 @@ "quickSearch": 0, "filterable": 0 }, + { + "key": "dr_影视工厂", + "name": "影视工厂(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=影视工厂", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_玩偶姐姐", "name": "玩偶姐姐(道长)", @@ -71,8 +107,8 @@ "name": "看视界(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=看视界", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -80,8 +116,17 @@ "name": "莫扎兔(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=莫扎兔", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, + { + "key": "dr_蓝光影院", + "name": "蓝光影院(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=蓝光影院", + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -98,8 +143,8 @@ "name": "鸭奈飞(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=鸭奈飞", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 } ], diff --git a/txt/pycms1.json b/txt/pycms1.json index 66d6e23..47e2bf4 100644 --- a/txt/pycms1.json +++ b/txt/pycms1.json @@ -1,6 +1,6 @@ { "wallpaper": "http://192.168.10.99:5705/pics", - "dr_count": 11, + "dr_count": 16, "mode": 1, "sites": [ { @@ -17,8 +17,26 @@ "name": "cokemv(道长)", "type": 1, "api": "http://192.168.10.99:5705/vod?rule=cokemv", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "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 }, { @@ -30,13 +48,22 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_在线之家", + "name": "在线之家(道长)", + "type": 1, + "api": "http://192.168.10.99:5705/vod?rule=在线之家", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_夜空", "name": "夜空(道长)", "type": 1, "api": "http://192.168.10.99:5705/vod?rule=夜空", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -48,6 +75,15 @@ "quickSearch": 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_玩偶姐姐", "name": "玩偶姐姐(道长)", @@ -71,8 +107,8 @@ "name": "看视界(道长)", "type": 1, "api": "http://192.168.10.99:5705/vod?rule=看视界", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -80,8 +116,17 @@ "name": "莫扎兔(道长)", "type": 1, "api": "http://192.168.10.99:5705/vod?rule=莫扎兔", - "searchable": 0, - "quickSearch": 0, + "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 }, { @@ -98,8 +143,8 @@ "name": "鸭奈飞(道长)", "type": 1, "api": "http://192.168.10.99:5705/vod?rule=鸭奈飞", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 } ], diff --git a/txt/pycms2.json b/txt/pycms2.json index bef3874..1925b71 100644 --- a/txt/pycms2.json +++ b/txt/pycms2.json @@ -1,6 +1,6 @@ { "wallpaper": "http://cms.nokia.press/pics", - "dr_count": 11, + "dr_count": 16, "mode": 1, "sites": [ { @@ -17,8 +17,26 @@ "name": "cokemv(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=cokemv", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "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 }, { @@ -30,13 +48,22 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_在线之家", + "name": "在线之家(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=在线之家", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_夜空", "name": "夜空(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=夜空", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -48,6 +75,15 @@ "quickSearch": 0, "filterable": 0 }, + { + "key": "dr_影视工厂", + "name": "影视工厂(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=影视工厂", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_玩偶姐姐", "name": "玩偶姐姐(道长)", @@ -71,8 +107,8 @@ "name": "看视界(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=看视界", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -80,8 +116,17 @@ "name": "莫扎兔(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=莫扎兔", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, + { + "key": "dr_蓝光影院", + "name": "蓝光影院(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=蓝光影院", + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -98,8 +143,8 @@ "name": "鸭奈飞(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=鸭奈飞", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 } ], -- GitLab