read token from config

This commit is contained in:
Ben Sarmiento
2023-10-20 01:49:06 +02:00
parent 464f522fea
commit 0e442fc9be
9 changed files with 23 additions and 22 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"log"
"net/http"
"os"
"strings"
"github.com/aerogo/aero"
@@ -87,7 +86,7 @@ func Setup(app *aero.Application, c config.ConfigInterface, t *torrent.TorrentMa
}
unrestrictFn := func() (*realdebrid.UnrestrictResponse, error) {
return realdebrid.UnrestrictLink(os.Getenv("RD_TOKEN"), link)
return realdebrid.UnrestrictLink(c.GetToken(), link)
}
resp := realdebrid.RetryUntilOk(unrestrictFn)
if resp == nil {