提交 739adc4f 编写于 作者: H hjdhnx

增加了源代理功能

上级 eafa5615
......@@ -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
无法预览此类型文件
......@@ -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)}毫秒')
......
......@@ -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]
......
3.9.21
\ No newline at end of file
3.9.21beta1
\ No newline at end of file
......@@ -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 修复豆瓣
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册