diff --git a/base/config.py b/base/config.py index 88111f76a4e2a2c1e32f766a3feab719dde1ea36..b6cb9d4b182335e7a64be2113b7cfbd2bcc6b759 100644 --- a/base/config.py +++ b/base/config.py @@ -52,3 +52,4 @@ 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 +ENV = '{"bili_cookie":""}' # 自定义环境变量 diff --git a/base/rules.db b/base/rules.db index ecb6814ca12fd2e4802f9135325e7e172e42ddfb..d1ff63808460bf3f5dcf195578b32ec249bb94ab 100644 Binary files a/base/rules.db and b/base/rules.db differ diff --git a/controllers/service.py b/controllers/service.py index 9e986d5122bd9e01e099907af9108ddf255e438d..a28fd71783c7e9622f3d6548dfddba69fc003f4e 100644 --- a/controllers/service.py +++ b/controllers/service.py @@ -22,7 +22,7 @@ class storage_service(object): def __init__(self): conf_list = ['LIVE_URL', 'USE_PY', 'JS_MODE','JS0_DISABLE','JS0_PASSWORD','PLAY_URL', 'PLAY_DISABLE', 'LAZYPARSE_MODE', 'WALL_PAPER_ENABLE', - 'WALL_PAPER', 'UNAME', 'PWD', 'LIVE_MODE', 'CATE_EXCLUDE', 'TAB_EXCLUDE','SEARCH_TIMEOUT','MULTI_MODE','XR_MODE','ALI_TOKEN'] + 'WALL_PAPER', 'UNAME', 'PWD', 'LIVE_MODE', 'CATE_EXCLUDE', 'TAB_EXCLUDE','SEARCH_TIMEOUT','MULTI_MODE','XR_MODE','JS_PROXY','ENV','ALI_TOKEN'] for conf in conf_list: if not self.hasItem(conf): print(f'开始初始化{conf}') @@ -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','JS_PROXY','ALI_TOKEN'] + 'WALL_PAPER', 'UNAME', 'PWD', 'CATE_EXCLUDE', 'TAB_EXCLUDE','SEARCH_TIMEOUT','MULTI_MODE','XR_MODE','JS_PROXY','ENV','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/007\345\275\261\350\247\206.js" "b/js/007\345\275\261\350\247\206.js" index 26b08cacad138e56894e3fa15e812e97a85fd1a3..5a784ff7f5fccef8e7dbc12034c66aae6b73994b 100644 --- "a/js/007\345\275\261\350\247\206.js" +++ "b/js/007\345\275\261\350\247\206.js" @@ -2,6 +2,7 @@ muban.首图2.二级.tabs = '.nav-tabs.dpplay&&li'; var rule = Object.assign(muban.首图2,{ title:'007影视', ali_token:'{{ali_token}}', + bili_cookie:'{{bili_cookie}}', host:'https://www.007ts.me', url:'/channel/fyclass-fypage.html', searchUrl:'/search/**----------fypage---.html', diff --git a/js/version.txt b/js/version.txt index f186870853a1061df32abe5b278f79a695da16d0..43eda70be9707a7b15ab279f6b49f0730becdea0 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.21beta3 \ No newline at end of file +3.9.21beta4 \ No newline at end of file diff --git a/readme.md b/readme.md index 2ad7a98677a3061095cd3c3db600acc1ac48b079..d348c055bb274f6a1023eb043f235e262e0d22bc 100644 --- a/readme.md +++ b/readme.md @@ -48,6 +48,11 @@ [dockerfile教程](https://blog.csdn.net/qq_46158060/article/details/125718218) [获取本地设备信息](https://blog.csdn.net/cui_yonghua/article/details/125508991) [获取本地设备信息](https://m.jb51.net/article/140716.htm) +###### 2022/11/21 +- [X] 重新定义依赖代理逻辑 +- [X] 设置中心增加自定义环境变量,演示源:007影视.js +- [X] 界面优化,升级至3.9.21beta4 +- [X] 修复自建鸿途解析 ###### 2022/11/20 - [X] 维护一波可用的自建解析 - [X] 未来功能-解析管理中心增加了对解析的点击访问测试 diff --git a/utils/env.py b/utils/env.py index a0b703f61cf12e00a53c9bd21411dfd1d09c810a..6e1c41092d970e94e54574fc1a02cb26e13132f1 100644 --- a/utils/env.py +++ b/utils/env.py @@ -5,6 +5,7 @@ # Date : 2022/11/21 from utils.cfg import cfg +import ujson from controllers.service import storage_service def get_env(): @@ -18,4 +19,15 @@ def get_env(): 'js_proxy':new_conf.JS_PROXY, 'fl':'{{fl}}' # 防止被依赖代理 } + ENV = new_conf.ENV.strip() + if ENV: + # print(ENV) + try: + ENV = ujson.loads(ENV) + except Exception as e: + print(f'自定义环境变量有误,不是合法json:{e}') + ENV = {} + if ENV: + env.update(ENV) + # print(env) return env \ No newline at end of file