diff --git a/api/main.py b/api/main.py
index bbe2716..a24ef52 100644
--- a/api/main.py
+++ b/api/main.py
@@ -26,6 +26,7 @@ class ServerInfoHandler(api.base.ApiHandler):
self.write({
'version': update.VERSION,
'config': {
- 'enableTranslate': cfg.enable_translate
+ 'enableTranslate': cfg.enable_translate,
+ 'loaderUrl': cfg.loader_url
}
})
diff --git a/config.py b/config.py
index 2e0f60a..ec3dc92 100644
--- a/config.py
+++ b/config.py
@@ -39,6 +39,7 @@ class AppConfig:
self.enable_translate = True
self.allow_translate_rooms = {}
self.tornado_xheaders = False
+ self.loader_url = ''
def load(self, path):
try:
@@ -49,7 +50,7 @@ class AppConfig:
self.database_url = app_section['database_url']
self.enable_translate = app_section.getboolean('enable_translate')
- allow_translate_rooms = app_section['allow_translate_rooms'].strip()
+ allow_translate_rooms = app_section['allow_translate_rooms']
if allow_translate_rooms == '':
self.allow_translate_rooms = {}
else:
@@ -57,6 +58,7 @@ class AppConfig:
self.allow_translate_rooms = set(map(lambda id_: int(id_.strip()), allow_translate_rooms))
self.tornado_xheaders = app_section.getboolean('tornado_xheaders')
+ self.loader_url = app_section['loader_url']
except (KeyError, ValueError):
logger.exception('Failed to load config:')
diff --git a/data/config.ini b/data/config.ini
index 0a4c704..b0df8ce 100644
--- a/data/config.ini
+++ b/data/config.ini
@@ -12,6 +12,9 @@ allow_translate_rooms =
# Set to true if you are using a reverse proxy server such as nginx
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
+
# DON'T modify this section
[DEFAULT]
@@ -19,3 +22,4 @@ database_url = sqlite:///data/database.db
enable_translate = true
allow_translate_rooms =
tornado_xheaders = false
+loader_url =
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index a6a9160..8ce59d3 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -66,7 +66,7 @@
-
+
{{$t('home.copy')}}
@@ -90,7 +90,8 @@ export default {
data() {
return {
serverConfig: {
- enableTranslate: true
+ enableTranslate: true,
+ loaderUrl: ''
},
form: {
roomId: parseInt(window.localStorage.roomId || '1'),
@@ -108,11 +109,14 @@ export default {
let resolved = this.$router.resolve({name: 'room', params: {roomId: this.form.roomId}, query})
return `${window.location.protocol}//${window.location.host}${resolved.href}`
},
- loaderUrl() {
+ obsRoomUrl() {
if (this.roomUrl === '') {
return ''
}
- let url = new URL('https://xfgryujk.sinacloud.net/blivechat/loader.html')
+ if (this.serverConfig.loaderUrl === '') {
+ return this.roomUrl
+ }
+ let url = new URL(this.serverConfig.loaderUrl)
url.searchParams.append('url', this.roomUrl)
return url.href
}