mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-12 02:30:40 +08:00
添加启动时打开浏览器配置项
This commit is contained in:
parent
ecb4a08e56
commit
aea6f12bd2
@ -52,6 +52,7 @@ class AppConfig:
|
||||
self.database_url = 'sqlite:///data/database.db'
|
||||
self.tornado_xheaders = False
|
||||
self.loader_url = ''
|
||||
self.open_browser_at_startup = True
|
||||
self.enable_upload_file = True
|
||||
|
||||
self.fetch_avatar_interval = 3.5
|
||||
@ -80,6 +81,8 @@ class AppConfig:
|
||||
self.database_url = app_section.get('database_url', self.database_url)
|
||||
self.tornado_xheaders = app_section.getboolean('tornado_xheaders', fallback=self.tornado_xheaders)
|
||||
self.loader_url = app_section.get('loader_url', self.loader_url)
|
||||
self.open_browser_at_startup = app_section.getboolean('open_browser_at_startup',
|
||||
fallback=self.open_browser_at_startup)
|
||||
self.enable_upload_file = app_section.getboolean('enable_upload_file', fallback=self.enable_upload_file)
|
||||
|
||||
self.fetch_avatar_interval = app_section.getfloat('fetch_avatar_interval', fallback=self.fetch_avatar_interval)
|
||||
|
@ -15,6 +15,10 @@ tornado_xheaders = false
|
||||
# Use a loader so that you can run OBS before blivechat. If empty, no loader is used
|
||||
loader_url = https://xfgryujk.sinacloud.net/blivechat/loader.html
|
||||
|
||||
# 启动时打开浏览器
|
||||
# Open browser at startup
|
||||
open_browser_at_startup = true
|
||||
|
||||
# 允许上传自定义表情文件
|
||||
# Enable uploading custom emote file
|
||||
enable_upload_file = true
|
||||
@ -112,9 +116,9 @@ region = ap-shanghai
|
||||
[baidu_translate]
|
||||
# 文档:https://fanyi-api.baidu.com/
|
||||
# 定价:https://fanyi-api.baidu.com/product/112
|
||||
# * 标准版完全免费,不限使用字符量(QPS=1)
|
||||
# * 高级版每月前200万字符免费,超出后仅收取超出部分费用(QPS=10),49元/百万字符
|
||||
# * 尊享版每月前200万字符免费,超出后仅收取超出部分费用(QPS=100),49元/百万字符
|
||||
# * 标准版每月前5万字符免费,超出仅收取超出部分费用(QPS=1),按49元/百万字符计费
|
||||
# * 高级版每月前100万字符免费,超出仅收取超出部分费用(QPS=10),按49元/百万字符计费
|
||||
# * 尊享版每月前200万字符免费,超出后仅收取超出部分费用(QPS=100),按49元/百万字符计费
|
||||
|
||||
# 类型:百度翻译
|
||||
type = BaiduTranslate
|
||||
|
5
main.py
5
main.py
@ -97,8 +97,9 @@ def run_server(host, port, debug):
|
||||
logger.warning('Address is used %s:%d', host, port)
|
||||
return
|
||||
finally:
|
||||
url = 'http://localhost/' if port == 80 else f'http://localhost:{port}/'
|
||||
webbrowser.open(url)
|
||||
if cfg.open_browser_at_startup:
|
||||
url = 'http://localhost/' if port == 80 else f'http://localhost:{port}/'
|
||||
webbrowser.open(url)
|
||||
logger.info('Server started: %s:%d', host, port)
|
||||
tornado.ioloop.IOLoop.current().start()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user