diff --git a/main.go b/main.go index acc3da9..f251df1 100644 --- a/main.go +++ b/main.go @@ -373,7 +373,15 @@ func main() { return } - if err := torrentClient.AddTorrentFromMemory(data, map[string]string{}); err != nil { + opts := make(map[string]string) + if category, ok := os.LookupEnv("QBITTORRENT_CATEGORY"); ok { + opts["category"] = category + } + if savePath, ok := os.LookupEnv("QBITTORRENT_SAVEPATH"); ok { + opts["savepath"] = savePath + } + + if err := torrentClient.AddTorrentFromMemory(data, opts); err != nil { http.Error(w, err.Error(), 500) return }