-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
95 lines (69 loc) · 2.51 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -*- coding: utf-8 -*-
# __author__ = '[email protected]'
# @Time : 2020/08/05
import os
import json
from collections import namedtuple
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'xxx'
CACHE_KEY = "bouyomi:%s"
# 微軟 Azure 文字轉語音服務
#
SPEECH_ACTIVE = False
SPEECH_TOKEN = "YOUR-SPEECH-TOKEN"
SPEECH_REGION = "YOUR-SPEECH-REGION"
SPEECH_VOICE_NAME = "YOUR-SPEECH-VOICE-NAME"
SPEECH_VOICE_PROSODY_RATE = "1.0"
# Twitch 直播留言設定
# [!注意!]
# TWITCH_NICKNAME
# 隨便填啦,目前不知道會用在哪邊。
# TWITCH_CHANNEL
# TWITCH_OAUTH_TOKEN
# 至少需要這兩項資料,才能啟動聊天室監聽服務
# OAuth Token 可以從這裡獲得 https://twitchapps.com/tmi/
# TWITCH_CLIENT_ID
# TWITCH_BEARER_TOKEN
# 取得使用者名稱、大頭貼的部分,需要透過 Twitch 應用程式來申請
# Twitch 應用程式 https://dev.twitch.tv/console/apps
TWITCH_ACTIVE = False
TWITCH_CHANNEL = "YOUR_TWITCH_CHANNEL"
TWITCH_NICKNAME = "YOUR_TWITCH_NICKNAME"
TWITCH_OAUTH_TOKEN = "YOUR_TWITCH_OAUTH_TOKEN"
TWITCH_CLIENT_ID = "YOUR_TWITCH_CLIENT_ID"
TWITCH_BEARER_TOKEN = "YOUR_TWITCH_BEARER_TOKEN"
# Facebook 直播留言設定
# [!注意!]
# Access Token 必須擁有 publish_pages 的權限,以獲得公開的留言資訊。
# Live video id 是每次開啟直播後,直播所給予的 ID,所以每次直播都需要更新這項資料。
FACEBOOK_ACTIVE = False
FACEBOOK_ACCESS_TOKEN = "YOUR_FACEBOOK_ACCESS_TOKEN"
FACEBOOK_LIVE_VIDEO_ID = "YOUR_FACEBOOK_LIVE_VIDEO_ID"
# YouTube 直播留言設定
# [!注意!]
# Live video id 是每次開啟直播後,直播所給予的 ID,所以每次直播都需要更新這項資料。
YOUTUBE_ACTIVE = False
YOUTUBE_LIVE_VIDEO_ID = "YOUR_YOUTUBE_VIDEO_ID"
# DouYu 直播留言設定
DOUYU_ACTIVE = False
DOUYU_ROOM_ID = "YOUR_DOUYU_ROOM_ID"
DOUYU_BARRAGE_HOST = "YOU_DOUYU_BARRAGE_HOST"
@staticmethod
def init_app(app):
pass
# 開發
class DevelopmentConfig(Config):
DEBUG = True
# 測試
class TestingConfig(Config):
TESTING = True
# 正式
class ProductionConfig(Config):
TESTING = False
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}