2021-04-18 17:54:41 +08:00
|
|
|
|
# 如果要修改配置,可以复制此文件并重命名为“config.ini”再修改
|
|
|
|
|
# If you want to modify the configuration, copy this file and rename it to "config.ini" and edit
|
|
|
|
|
|
2020-02-03 16:18:21 +08:00
|
|
|
|
[app]
|
2020-11-28 22:56:45 +08:00
|
|
|
|
# 数据库配置,见https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
|
2020-02-03 16:18:21 +08:00
|
|
|
|
# See https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
|
|
|
|
|
database_url = sqlite:///data/database.db
|
2020-08-22 18:38:52 +08:00
|
|
|
|
|
2021-04-20 21:30:57 +08:00
|
|
|
|
# 如果使用了nginx之类的反向代理服务器,设置为true
|
|
|
|
|
# Set to true if you are using a reverse proxy server such as nginx
|
|
|
|
|
tornado_xheaders = false
|
|
|
|
|
|
|
|
|
|
# 加载器URL,本地使用时加载器可以让你先运行OBS再运行blivechat。如果为空,不使用加载器
|
|
|
|
|
# **自建服务器时强烈建议不使用加载器**,否则可能因为混合HTTP和HTTPS等原因加载不出来
|
|
|
|
|
# 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
|
|
|
|
|
|
2022-02-27 22:05:37 +08:00
|
|
|
|
# 允许上传自定义表情文件
|
|
|
|
|
# Enable uploading custom emote file
|
|
|
|
|
enable_upload_file = true
|
|
|
|
|
|
2021-04-20 21:30:57 +08:00
|
|
|
|
|
|
|
|
|
# 获取头像间隔时间(秒)。如果小于3秒有很大概率被服务器拉黑
|
2021-12-31 00:45:47 +08:00
|
|
|
|
# Interval between fetching avatars (seconds). At least 3 seconds is recommended
|
2021-04-20 21:30:57 +08:00
|
|
|
|
fetch_avatar_interval = 3.5
|
|
|
|
|
|
|
|
|
|
# 获取头像最大队列长度,注意最长等待时间等于 最大队列长度 * 请求间隔时间
|
|
|
|
|
# Maximum queue length for fetching avatar
|
|
|
|
|
fetch_avatar_max_queue_size = 2
|
|
|
|
|
|
|
|
|
|
# 头像缓存数量
|
|
|
|
|
# Number of avatar caches
|
|
|
|
|
avatar_cache_size = 50000
|
|
|
|
|
|
|
|
|
|
|
2020-11-28 22:56:45 +08:00
|
|
|
|
# 允许自动翻译到日语
|
2020-02-06 17:39:56 +08:00
|
|
|
|
# Enable auto translate to Japanese
|
|
|
|
|
enable_translate = true
|
2020-08-22 18:38:52 +08:00
|
|
|
|
|
2020-11-28 22:56:45 +08:00
|
|
|
|
# 允许翻译的房间ID,以逗号分隔。如果为空,允许所有房间
|
2021-12-31 00:45:47 +08:00
|
|
|
|
# Comma separated room IDs in which translation are allowed. If empty, all rooms are allowed
|
2020-08-16 12:13:53 +08:00
|
|
|
|
# Example: allow_translate_rooms = 4895312,22347054,21693691
|
|
|
|
|
allow_translate_rooms =
|
2020-02-03 16:18:21 +08:00
|
|
|
|
|
2021-04-20 21:30:57 +08:00
|
|
|
|
# 翻译缓存数量
|
|
|
|
|
# Number of translation caches
|
|
|
|
|
translation_cache_size = 50000
|
2021-04-11 14:16:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
|
|
|
|
# 以下是给字幕组看的,实在懒得翻译了_(:з」∠)_。如果你不了解以下参数的意思,使用默认值就好
|
|
|
|
|
# **The following is for translation team. Leave it default if you don't know its meaning**
|
2021-04-11 22:11:13 +08:00
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
2021-04-11 14:16:32 +08:00
|
|
|
|
|
2021-04-20 22:09:47 +08:00
|
|
|
|
# 翻译器配置,索引到下面的配置节。可以以逗号分隔配置多个翻译器,翻译时会自动负载均衡
|
2021-04-11 22:11:13 +08:00
|
|
|
|
# 配置多个翻译器可以增加额度、增加QPS、容灾
|
|
|
|
|
# 不同配置可以使用同一个类型,但要使用不同的账号,否则还是会遇到额度、调用频率限制
|
2021-04-11 14:16:32 +08:00
|
|
|
|
translator_configs = tencent_translate_free,bilibili_translate_free
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tencent_translate_free]
|
|
|
|
|
# 类型:腾讯翻译白嫖版。使用了网页版的接口,**将来可能失效**
|
|
|
|
|
type = TencentTranslateFree
|
2021-04-11 22:11:13 +08:00
|
|
|
|
|
2021-04-11 14:16:32 +08:00
|
|
|
|
# 请求间隔时间(秒),等于 1 / QPS。目前没有遇到此接口有调用频率限制,10QPS应该够用了
|
|
|
|
|
query_interval = 0.1
|
|
|
|
|
# 最大队列长度,注意最长等待时间等于 最大队列长度 * 请求间隔时间
|
|
|
|
|
max_queue_size = 100
|
2021-04-11 22:11:13 +08:00
|
|
|
|
|
2021-04-11 14:16:32 +08:00
|
|
|
|
# 自动:auto;中文:zh;日语:jp;英语:en;韩语:kr
|
|
|
|
|
# 完整语言列表见文档:https://cloud.tencent.com/document/product/551/15619
|
|
|
|
|
# 源语言
|
|
|
|
|
source_language = zh
|
|
|
|
|
# 目标语言
|
|
|
|
|
target_language = jp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[bilibili_translate_free]
|
|
|
|
|
# 类型:B站翻译白嫖版。使用了B站直播网页的接口,**将来可能失效**。目前B站翻译后端是百度翻译
|
|
|
|
|
type = BilibiliTranslateFree
|
2021-04-11 22:11:13 +08:00
|
|
|
|
|
2021-04-11 14:16:32 +08:00
|
|
|
|
# 请求间隔时间(秒),等于 1 / QPS。目前此接口频率限制是3秒一次
|
|
|
|
|
query_interval = 3.1
|
|
|
|
|
# 最大队列长度,注意最长等待时间等于 最大队列长度 * 请求间隔时间
|
|
|
|
|
max_queue_size = 3
|
2021-04-11 22:11:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tencent_translate]
|
|
|
|
|
# 文档:https://cloud.tencent.com/product/tmt
|
|
|
|
|
# 定价:https://cloud.tencent.com/document/product/551/35017
|
|
|
|
|
# * 文本翻译的每月免费额度为5百万字符
|
|
|
|
|
# * 文本翻译当月需付费字符数小于100百万字符(1亿字符)时,刊例价为58元/每百万字符
|
|
|
|
|
# * 文本翻译当月需付费字符数大于等于100百万字符(1亿字符)时,刊例价为50元/每百万字符
|
|
|
|
|
# 限制:https://cloud.tencent.com/document/product/551/32572
|
|
|
|
|
# * 文本翻译最高QPS为5
|
|
|
|
|
|
|
|
|
|
# 类型:腾讯翻译
|
|
|
|
|
type = TencentTranslate
|
|
|
|
|
|
|
|
|
|
# 请求间隔时间(秒),等于 1 / QPS。理论上最高QPS为5,实际测试是3
|
|
|
|
|
query_interval = 0.333
|
|
|
|
|
# 最大队列长度,注意最长等待时间等于 最大队列长度 * 请求间隔时间
|
|
|
|
|
max_queue_size = 30
|
|
|
|
|
|
2021-12-31 00:45:47 +08:00
|
|
|
|
# 自动:auto;中文:zh;日语:ja;英语:en;韩语:ko
|
2021-04-11 22:11:13 +08:00
|
|
|
|
# 完整语言列表见文档:https://cloud.tencent.com/document/product/551/15619
|
|
|
|
|
# 源语言
|
|
|
|
|
source_language = zh
|
|
|
|
|
# 目标语言
|
2021-12-31 00:45:47 +08:00
|
|
|
|
target_language = ja
|
2021-04-11 22:11:13 +08:00
|
|
|
|
|
|
|
|
|
# 腾讯云API密钥
|
|
|
|
|
secret_id =
|
|
|
|
|
secret_key =
|
|
|
|
|
|
2021-12-31 00:45:47 +08:00
|
|
|
|
# 腾讯云地域参数,用来标识希望操作哪个地域的数据,建议按照运行blivechat的机器所在地区就近选择
|
2021-04-11 22:11:13 +08:00
|
|
|
|
# 北京:ap-beijing;上海:ap-shanghai;香港:ap-hongkong;首尔:ap-seoul
|
|
|
|
|
# 完整地域列表见文档:https://cloud.tencent.com/document/api/551/15615#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8
|
|
|
|
|
region = ap-shanghai
|
2021-04-23 21:35:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[baidu_translate]
|
|
|
|
|
# 文档:https://fanyi-api.baidu.com/
|
|
|
|
|
# 定价:https://fanyi-api.baidu.com/product/112
|
|
|
|
|
# * 标准版完全免费,不限使用字符量(QPS=1)
|
|
|
|
|
# * 高级版每月前200万字符免费,超出后仅收取超出部分费用(QPS=10),49元/百万字符
|
|
|
|
|
# * 尊享版每月前200万字符免费,超出后仅收取超出部分费用(QPS=100),49元/百万字符
|
|
|
|
|
|
|
|
|
|
# 类型:百度翻译
|
|
|
|
|
type = BaiduTranslate
|
|
|
|
|
|
|
|
|
|
# 请求间隔时间(秒),等于 1 / QPS
|
|
|
|
|
query_interval = 1.5
|
|
|
|
|
# 最大队列长度,注意最长等待时间等于 最大队列长度 * 请求间隔时间
|
|
|
|
|
max_queue_size = 9
|
|
|
|
|
|
|
|
|
|
# 自动:auto;中文:zh;日语:jp;英语:en;韩语:kor
|
|
|
|
|
# 完整语言列表见文档:https://fanyi-api.baidu.com/doc/21
|
|
|
|
|
# 源语言
|
|
|
|
|
source_language = zh
|
|
|
|
|
# 目标语言
|
|
|
|
|
target_language = jp
|
|
|
|
|
|
|
|
|
|
# 百度翻译开放平台应用ID和密钥
|
|
|
|
|
app_id =
|
|
|
|
|
secret =
|