From b6b1761cb368d93c4b1bcd99d5077a159c125ee8 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Sun, 28 Aug 2022 12:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E8=A7=A3=E6=9E=90=E5=85=A8=E5=B1=80=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/cms.py | 20 +++++++++++++------- config.py | 3 ++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/classes/cms.py b/classes/cms.py index 3b8ffcc..a0f500d 100644 --- a/classes/cms.py +++ b/classes/cms.py @@ -20,16 +20,22 @@ class CMS: def __init__(self, rule, db=None, RuleClass=None, new_conf=None): if new_conf is None: new_conf = {} - self.play_parse = rule.get('play_parse', False) - play_url = new_conf.get('PLAY_URL',getHost(1)) - if not play_url.startswith('http'): - play_url = 'http://'+play_url + self.play_disable = new_conf.get('PLAY_DISABLE',False) self.vod = redirect(url_for('vod')).headers['Location'] - if self.play_parse: - self.play_url = play_url + self.vod + '?play_url=' - logger.info(f'cms重定向链接:{self.play_url}') + if not self.play_disable: + self.play_parse = rule.get('play_parse', False) + play_url = new_conf.get('PLAY_URL',getHost(1)) + if not play_url.startswith('http'): + play_url = 'http://'+play_url + if self.play_parse: + self.play_url = play_url + self.vod + '?play_url=' + logger.info(f'cms重定向链接:{self.play_url}') + else: + self.play_url = '' else: + self.play_parse = False self.play_url = '' + self.db = db self.RuleClass = RuleClass host = rule.get('host','').rstrip('/') diff --git a/config.py b/config.py index cdef035..f78c637 100644 --- a/config.py +++ b/config.py @@ -18,4 +18,5 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ECHO = False # 打印sql语句 JSON_AS_ASCII = False # jsonify返回的中文正常显示 # PLAY_URL = 'http://localhost:5705' # 匹配远程解析服务器链接 -# PLAY_URL = PLAY_URL.rstrip('/') \ No newline at end of file +# PLAY_URL = PLAY_URL.rstrip('/') +PLAY_DISABLE = False # 全局禁用播放解析 \ No newline at end of file -- GitLab