diff --git a/classes/cms.py b/classes/cms.py index 3b8ffcc4aaaf0721a9678fb1c12dd74913b3fbdd..a0f500daf82dfa626fde0d997be63de85194da1c 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 cdef0356c3ffc4875d56535d9ac3c5ac29fea9c5..f78c63792d07df25208c380c6d32912f74fb2716 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