diff --git a/base/config.py b/base/config.py index 3100dfb3ac6ad48f5b28c508322d28da0edef7b5..88111f76a4e2a2c1e32f766a3feab719dde1ea36 100644 --- a/base/config.py +++ b/base/config.py @@ -50,4 +50,5 @@ TAB_EXCLUDE = '猜你|喜欢|APP|下载|剧情|简介|排序' # 动态线路名 SEARCH_TIMEOUT = 5000 # 聚搜超时毫秒 MULTI_MODE = 0 # 多源模式 XR_MODE = 1 # 仙人模式 +JS_PROXY = 'http://localhost:5705/admin/view/=>https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/' # 源代理 ALI_TOKEN = '' # 适用于初始配置的阿里云token diff --git a/base/rules.db b/base/rules.db index 726ea491e66a8d8ef0f5299f916429bfab3efc15..083de5f3bccb109e2f73c9786edf61b077bf159c 100644 Binary files a/base/rules.db and b/base/rules.db differ diff --git a/controllers/home.py b/controllers/home.py index a47862d0b0f934badf7b14fcbcfc5fba1c93fa67..ad7831f0ef07df77b7a39ee7236a98dff7f31866 100644 --- a/controllers/home.py +++ b/controllers/home.py @@ -232,6 +232,7 @@ def config_render(mode): # ali_token = lsg.getItem('ALI_TOKEN') ali_token = new_conf.ALI_TOKEN xr_mode = new_conf.XR_MODE + js_proxy = new_conf.JS_PROXY js0_password = new_conf.JS0_PASSWORD js_mode = int(new_conf.JS_MODE or 0) print(f'{type(js_mode)} jsmode:{js_mode}') @@ -260,7 +261,15 @@ def config_render(mode): parses = sort_parses_by_order(merged_config['parses'],host) # print(parses) merged_config['parses'] = parses - response = make_response(json.dumps(merged_config,ensure_ascii=False,indent=1)) + config_text = json.dumps(merged_config,ensure_ascii=False,indent=1) + if js_proxy: + # print('js_proxy:',js_proxy) + if '=>' in js_proxy: + oldsrc = js_proxy.split('=>')[0] + newsrc = js_proxy.split('=>')[1] + print(f'js1源代理已启用,全局替换{oldsrc}为{newsrc}') + config_text = config_text.replace(oldsrc,newsrc) + response = make_response(config_text) # response = make_response(str(merged_config)) response.headers['Content-Type'] = 'application/json; charset=utf-8' logger.info(f'自动生成动态配置共计耗时:{get_interval(tt)}毫秒') diff --git a/controllers/service.py b/controllers/service.py index fc43044848601fd86e1b98027e9810d716841a06..9e986d5122bd9e01e099907af9108ddf255e438d 100644 --- a/controllers/service.py +++ b/controllers/service.py @@ -32,9 +32,9 @@ class storage_service(object): def getStoreConf(self): # MAX_CONTENT_LENGTH 最大上传和端口ip一样是顶级配置,无法外部修改的 conf_list = ['LIVE_URL', 'LIVE_MODE','PLAY_URL', 'PID_URL','USE_PY','JS_MODE', 'JS0_DISABLE','JS0_PASSWORD','PLAY_DISABLE', 'LAZYPARSE_MODE', 'WALL_PAPER_ENABLE', - 'WALL_PAPER', 'UNAME', 'PWD', 'CATE_EXCLUDE', 'TAB_EXCLUDE','SEARCH_TIMEOUT','MULTI_MODE','XR_MODE','ALI_TOKEN'] + 'WALL_PAPER', 'UNAME', 'PWD', 'CATE_EXCLUDE', 'TAB_EXCLUDE','SEARCH_TIMEOUT','MULTI_MODE','XR_MODE','JS_PROXY','ALI_TOKEN'] conf_name_list = ['直播地址', '直播模式','远程地址', '进程管理链接','启用py源', 'js模式','禁用js0','js0密码','禁用免嗅', '免嗅模式', '启用壁纸', '壁纸链接', '管理账号', - '管理密码', '分类排除', '线路排除','聚搜超时','多源模式','仙人模式','阿里tk'] + '管理密码', '分类排除', '线路排除','聚搜超时','多源模式','仙人模式','源代理','阿里tk'] conf_lists = [] for i in range(len(conf_list)): conf = conf_list[i] diff --git a/js/version.txt b/js/version.txt index 37505573190857d0d15e4ef88aa22a7a2c166ad6..d580dfe93a2052abf25589547a72f00be0d7ff9c 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.21 \ No newline at end of file +3.9.21beta1 \ No newline at end of file diff --git a/readme.md b/readme.md index ae9cf569e64182183eea00e2d9e69f2c68e5b76b..4a875e87f3ded32adb489a06b89788cc08d73513 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,7 @@ ###### 2022/11/17 - [X] 海盗听书js0播放bug修复 - [X] 升级至 3.9.21 +- [X] 设置中心增加源代理,提高js1搜索速度 ###### 2022/11/08 - [X] 海盗听书js0空白是触发了网页的cloudfare5秒盾了,暂时无解 - [X] 3.9.20beta7 修复豆瓣