Fix unrestrict issue

This commit is contained in:
Ben Sarmiento
2023-11-28 00:41:15 +01:00
parent c8334ecb3b
commit 3d380e468f
9 changed files with 131 additions and 68 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"net/http"
"os"
"time"
"github.com/debridmediamanager.com/zurg/internal/config"
"github.com/debridmediamanager.com/zurg/internal/net"
@@ -16,7 +15,6 @@ import (
zurghttp "github.com/debridmediamanager.com/zurg/pkg/http"
"github.com/debridmediamanager.com/zurg/pkg/logutil"
"github.com/debridmediamanager.com/zurg/pkg/realdebrid"
"github.com/hashicorp/golang-lru/v2/expirable"
_ "net/http/pprof"
)
@@ -43,8 +41,6 @@ func main() {
os.Exit(1)
}
cache := expirable.NewLRU[string, string](1e4, nil, time.Hour)
apiClient := zurghttp.NewHTTPClient(config.GetToken(), 5, 15, config, log.Named("httpclient"))
rd := realdebrid.NewRealDebrid(apiClient, log.Named("realdebrid"))
@@ -59,7 +55,6 @@ func main() {
torrentMgr := torrent.NewTorrentManager(config, rd, p, log.Named("manager"))
downloadClient := zurghttp.NewHTTPClient("", 5, 0, config, log.Named("dlclient"))
getfile := universal.NewGetFile(downloadClient)
go func() {
@@ -67,7 +62,7 @@ func main() {
}()
mux := http.NewServeMux()
net.Router(mux, getfile, config, torrentMgr, cache, log.Named("net"))
net.Router(mux, getfile, config, torrentMgr, log.Named("net"))
addr := fmt.Sprintf("%s:%s", config.GetHost(), config.GetPort())
server := &http.Server{Addr: addr, Handler: mux}