diff --git a/app.py b/app.py index 376281426c714935c6b535da358689ea247e3cc9..7134905f2f1ebcf0a57cf2ae87e345f14b2d821b 100644 --- a/app.py +++ b/app.py @@ -111,7 +111,8 @@ def vod(): play_url = getParmas('play_url') if play_url: # 播放 - play_url = cms.playContent(play_url) + jxs = getJxs() + play_url = cms.playContent(play_url,jxs) return redirect(play_url) if ac and t: # 一级 @@ -230,9 +231,14 @@ def rules_raw(): @app.route('/pics') def random_pics(): + id = getParmas('id') + # print(f'id:{id}') pics = getPics() if len(pics) > 0: - pic = random.choice(pics) + if id and f'images/{id}.jpg' in pics: + pic = f'images/{id}.jpg' + else: + pic = random.choice(pics) file = open(pic, "rb").read() response = make_response(file) response.headers['Content-Type'] = 'image/jpeg' diff --git a/classes/cms.py b/classes/cms.py index b063bcec76e01961cb085317599b11d4bd7082dd..7be4019dcfbaf70628e37a17f62a0e29c8b6fdb1 100644 --- a/classes/cms.py +++ b/classes/cms.py @@ -619,7 +619,9 @@ class CMS: } return result - def playContent(self, play_url): + def playContent(self, play_url,jxs=None): + if not jxs: + jxs = [] if self.lazy: print(f'{play_url}->开始执行免嗅代码->{self.lazy}') if not str(self.lazy).startswith('js:'): @@ -641,10 +643,12 @@ class CMS: py_ctx.update({ 'input': play_url, 'd': self.d, + 'jxs':jxs, 'pdfh': self.d.jsp.pdfh, 'pdfa': self.d.jsp.pdfa, 'pd': self.d.jsp.pd, }) ctx = py_ctx + # print(ctx) loader,_ = runJScode(jscode,ctx=ctx) # print(loader.toString()) play_url = loader.eval('input') diff --git a/config.py b/config.py index 18bbacb28725740ffc684acb4b235aaa34b4e833..c3309921d6e85f77249db841d8edd51d995cdeea 100644 --- a/config.py +++ b/config.py @@ -20,5 +20,6 @@ JSON_AS_ASCII = False # jsonify返回的中文正常显示 # PLAY_URL = 'http://localhost:5705' # 匹配远程解析服务器链接 # PLAY_URL = PLAY_URL.rstrip('/') PLAY_DISABLE = False # 全局禁用播放解析 +WALL_PAPER_ENABLE = True # 启用自定义壁纸 WALL_PAPER = "https://picsum.photos/1280/720/?blur=10" # 自定义壁纸,可注释 # {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %} \ No newline at end of file diff --git a/images/2.jpg b/images/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a0432c60ef9e89553d7c04c2a6155da91a4a4f45 Binary files /dev/null and b/images/2.jpg differ diff --git a/images/3.jpg b/images/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b5a75ed1a53fbd1ef941ee827d497c464cdbd47 Binary files /dev/null and b/images/3.jpg differ diff --git a/images/4.jpg b/images/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d1a76d31248ae181bef4d9ba538f03614863e5f0 Binary files /dev/null and b/images/4.jpg differ diff --git "a/images/\345\237\216\345\270\202\351\225\277\345\207\263.jpg" "b/images/\345\237\216\345\270\202\351\225\277\345\207\263.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..aebcdeba0f2905b9b2eb77a4ad8429ead02e008d Binary files /dev/null and "b/images/\345\237\216\345\270\202\351\225\277\345\207\263.jpg" differ diff --git "a/images/\347\273\277\346\236\227.jpg" "b/images/\347\273\277\346\236\227.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..16920263fe9b8d57faad3d243aaa50b1b90d0e40 Binary files /dev/null and "b/images/\347\273\277\346\236\227.jpg" differ diff --git "a/images/\351\253\230\351\223\201.jpg" "b/images/\351\253\230\351\223\201.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..6ad8802af53e2dc95765564afea4f164dea53efd Binary files /dev/null and "b/images/\351\253\230\351\223\201.jpg" differ diff --git a/models/rules.db b/models/rules.db index 71884e1396e2e5a1972ae29d5667317ff6992ca2..3e27f81d24bebfc722d86667f81fc81812032d8e 100644 Binary files a/models/rules.db and b/models/rules.db differ diff --git a/templates/config.txt b/templates/config.txt index 4f8ba81e968f8cbaaf1ae6688e04785be83e509a..9fe6b7cdd55541fde237e5fe724ce79e8213a4da 100644 --- a/templates/config.txt +++ b/templates/config.txt @@ -1,5 +1,5 @@ { -"wallpaper":"http://{{ host }}/pics", +{% if config.WALL_PAPER_ENABLE %}"wallpaper":"http://{{ host }}/pics",{% endif %} "dr_count": {{rules.list|length}}, "mode": {{ mode }}, "sites": [{% for rule in rules.list %}{% if mode == 0 %} diff --git a/templates/index.html b/templates/index.html index 86224e9127fa8f22522ab3c62ac5b9ffe6845d72..b121ed9ee537aa4d1f7fb7f257b7a531f4bf9ec8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -66,7 +66,7 @@ a { 本地配置地址 -

局域网:{{ getHost(1) }}

+局域网:{{ getHost(1) }} {% if '192.168' in getHost(1) %}
局域网配置地址 @@ -74,6 +74,9 @@ a {
局域网在线进程管理
+
+ 局域网随机图片 +
{% endif %}
远程配置地址