Skip to content

webtor-io/go-jackett

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-jackett

It is non-official Golang SDK for Jackett.

Example usage:

package main

import (
	"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:

j := jackett.NewJackett(&jackett.Settings{})

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages