Fix ipv6 stuffs 4

This commit is contained in:
Ben Sarmiento
2024-01-11 03:02:05 +01:00
parent 7ea90d0754
commit 9938c1134d
2 changed files with 60 additions and 54 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/debridmediamanager/zurg/internal/handlers"
"github.com/debridmediamanager/zurg/internal/torrent"
"github.com/debridmediamanager/zurg/internal/universal"
"github.com/debridmediamanager/zurg/pkg/hosts"
"github.com/debridmediamanager/zurg/pkg/http"
"github.com/debridmediamanager/zurg/pkg/logutil"
"github.com/debridmediamanager/zurg/pkg/premium"
@@ -36,7 +35,7 @@ func MainApp(configPath string) {
os.Exit(1)
}
apiClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), config.GetRealDebridTimeout(), nil, config, log.Named("httpclient"))
apiClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), config.GetRealDebridTimeout(), false, config, log.Named("httpclient"))
rd := realdebrid.NewRealDebrid(apiClient, log.Named("realdebrid"))
@@ -52,14 +51,7 @@ func MainApp(configPath string) {
utils.EnsureDirExists("data") // Ensure the data directory exists
torrentMgr := torrent.NewTorrentManager(config, rd, p, log.Named("manager"))
var ipv6List []string
if config.ShouldForceIPv6() {
ipv6List, err = hosts.FetchHosts(hosts.IPV6)
if err != nil {
zurglog.Warnf("Failed to fetch IPv6 hosts: %v", err)
}
}
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, ipv6List, config, log.Named("dlclient"))
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, true, config, log.Named("dlclient"))
downloader := universal.NewDownloader(downloadClient)
router := chi.NewRouter()