File size: 729 Bytes
435c11e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
package initialize

import (
	"bufio"
	groq "github.com/learnLi/groq_client"
	"groqai2api/global"
	"groqai2api/pkg/accountpool"
	"os"
)

func InitAuth() {
	var Secrets []*groq.Account
	// Read accounts.txt and create a list of accounts
	if _, err := os.Stat("session_tokens.txt"); err == nil {
		// Each line is a proxy, put in proxies array
		file, _ := os.Open("session_tokens.txt")
		defer file.Close()
		scanner := bufio.NewScanner(file)
		for scanner.Scan() {
			// Split by :
			token := scanner.Text()
			if len(token) == 0 {
				continue
			}
			// Append to accounts
			Secrets = append(Secrets, groq.NewAccount(token, ""))
		}
	}

	global.AccountPool = accountpool.NewAccounts(Secrets)
}