This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
/
tmi_environment.go
77 lines (68 loc) · 2.18 KB
/
tmi_environment.go
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
package main
import (
"os"
"fyne.io/fyne"
"fyne.io/fyne/widget"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"github.com/gorilla/sessions"
"github.com/nicklaw5/helix"
"golang.org/x/oauth2"
)
const ( // OAuth2 Key 상수
stateCallbackKey = "oauth-state-callback"
oauthSessionName = "oauth-session"
oauthTokenKey = "oauth-token"
)
const ( // API
tdownloaderAPI = "https://api.tmi.tips/request/tdownloader"
loginMemberAPI = "https://api.tmi.tips/request/LoginMember"
versionAPI = "https://api.tmi.tips/request/version"
)
var ( // Main 변수
version = "0703"
title = "TMI Downloader ver." + version
dirTemp string
dirThumb string
dirBin = VarOS("dirBin")
dirWebFonts = VarOS("dirWebFonts")
dirDefDown = VarOS("dirDefDown")
ffmpegURL = VarOS("ffmpegURL")
ffmpegBinary = VarOS("ffmpegBinary")
lang string
chromeStatus = CheckChrome()
checkClipboard bool
programUUID string
debugFileName string
err error
errCount int
)
var ( // 대기열 변수
queue = make(map[int]*QueueInfo)
nowProgress int
)
var ( // Twitch OAuth2 Info
clientID = "z0hu5c3qqq1r19om4hfpll7uzirzd0"
clientSecret = "i6zbcggkyhc970yknht90d7jn0bdfe"
scopes = []string{"channel:read:subscriptions", "user:read:email", "user_read", "channel_check_subscription", "user_subscriptions"}
redirectURL = "http://localhost:7001/redirect"
oauth2Config *oauth2.Config
cookieSecret = []byte("secret")
cookieStore = sessions.NewCookieStore(cookieSecret)
twitchAccessToken string
twitchRefreshToken string
twitchDisplayName string
twitchUserName string
twitchUserID string
twitchUserEmail string
)
var ( // Function 변수
debugLog *os.File
helixClient *helix.Client
intervalStartCheck, intervalStopCheck *widget.Check
keyEntry *enterEntry
a fyne.App
splWindow, w fyne.Window
bot *tgbotapi.BotAPI
queueContent *widget.Group
mainContent *fyne.Container
)