Features:

- Make Blackhole and Proxy optional
- Query all Hashes at once, speeeding up the process
- refractor the code a little bit
This commit is contained in:
Mukhtar Akere
2024-08-26 20:13:48 +01:00
parent 511df1a296
commit 74791d6e62
8 changed files with 188 additions and 89 deletions

View File

@@ -3,16 +3,33 @@ package cmd
import (
"goBlack/common"
"goBlack/debrid"
"log"
"sync"
)
func Start(config *common.Config) {
log.Print("[*] BlackHole running")
deb := debrid.NewDebrid(config.Debrid)
var wg sync.WaitGroup
if config.Proxy.Enabled {
go StartProxy(config, deb)
proxy := NewProxy(*config, deb)
wg.Add(1)
go func() {
defer wg.Done()
proxy.Start()
}()
}
StartBlackhole(config, deb)
if len(config.Arrs) > 0 {
wg.Add(1)
go func() {
defer wg.Done()
StartBlackhole(config, deb)
}()
}
// Wait indefinitely
wg.Wait()
}