diff --git a/app.py b/app.py index eb57ba074ab25636caec66ecec011692cc968dea..60cf070fe98b47953e672985a707fe7fabc18e22 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 77535b1d6adb4ca5a21aacea62915d854cf70764..e7533abf70f5a6e15a5b0536b6d0e809c50fcedb 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 66d6e23201c645adad7999c12557b33407fb1bd2..47e2bf49ce12c2e1651751f8925bfdabe65c9cc1 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 bef3874b84772bb51e28ed5d2ec76c8eb7399ede..1925b71c27b10f22d1447e45cd4e44ff13235d76 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 } ],