提交 b6b1761c 编写于 作者: H hjdhnx

增加了服务器解析全局禁用播放配置

上级 20492ff7
...@@ -20,16 +20,22 @@ class CMS: ...@@ -20,16 +20,22 @@ class CMS:
def __init__(self, rule, db=None, RuleClass=None, new_conf=None): def __init__(self, rule, db=None, RuleClass=None, new_conf=None):
if new_conf is None: if new_conf is None:
new_conf = {} new_conf = {}
self.play_parse = rule.get('play_parse', False) self.play_disable = new_conf.get('PLAY_DISABLE',False)
play_url = new_conf.get('PLAY_URL',getHost(1))
if not play_url.startswith('http'):
play_url = 'http://'+play_url
self.vod = redirect(url_for('vod')).headers['Location'] self.vod = redirect(url_for('vod')).headers['Location']
if self.play_parse: if not self.play_disable:
self.play_url = play_url + self.vod + '?play_url=' self.play_parse = rule.get('play_parse', False)
logger.info(f'cms重定向链接:{self.play_url}') 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: else:
self.play_parse = False
self.play_url = '' self.play_url = ''
self.db = db self.db = db
self.RuleClass = RuleClass self.RuleClass = RuleClass
host = rule.get('host','').rstrip('/') host = rule.get('host','').rstrip('/')
......
...@@ -18,4 +18,5 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False ...@@ -18,4 +18,5 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # 打印sql语句 SQLALCHEMY_ECHO = False # 打印sql语句
JSON_AS_ASCII = False # jsonify返回的中文正常显示 JSON_AS_ASCII = False # jsonify返回的中文正常显示
# PLAY_URL = 'http://localhost:5705' # 匹配远程解析服务器链接 # PLAY_URL = 'http://localhost:5705' # 匹配远程解析服务器链接
# PLAY_URL = PLAY_URL.rstrip('/') # PLAY_URL = PLAY_URL.rstrip('/')
\ No newline at end of file PLAY_DISABLE = False # 全局禁用播放解析
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册