https://github.com/webtor-io/go-jackett
Golang SDK for Jackett
https://github.com/webtor-io/go-jackett
golang jackett sdk
Last synced: about 1 month ago
JSON representation
Golang SDK for Jackett
- Host: GitHub
- URL: https://github.com/webtor-io/go-jackett
- Owner: webtor-io
- License: mit
- Created: 2020-11-10T15:40:07.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-10T16:07:22.000Z (almost 5 years ago)
- Last Synced: 2024-12-19T01:02:27.549Z (10 months ago)
- Topics: golang, jackett, sdk
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 33
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# go-jackett
It is non-official Golang SDK for [Jackett](https://github.com/Jackett/Jackett).
Example usage:
```golang
package mainimport (
"log"
"context"
"github.com/webtor-io/go-jackett"
)func main() {
ctx := context.Background()
j := jackett.NewJackett(&jackett.Settings{
ApiURL: "YOUR_API_URL",
ApiKey: "YOUR_API_KEY",
})
resp, err := j.Fetch(ctx, &jackett.FetchRequest{
Categories: []uint{7000},
Query: "Crime and Punishment",
})
if err != nil {
panic(err)
}
for _, r := range resp.Results {
log.Printf("%+v", r)
}
}
```As ApiUrl just use root url of your Jackett instance. ApiKey could be found at the top of Jackett UI.
It is also possible to get Jackett credentials from environment variables `JACKETT_API_URL` and `JACKETT_API_KEY`.
In this case just provide empty settings like so:```golang
j := jackett.NewJackett(&jackett.Settings{})
```