Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 3.26 KB

README.md

File metadata and controls

103 lines (77 loc) · 3.26 KB

NZBGet Go Module

GoDoc Go Report Card MIT License discord

Full-featured Go Library to interact with NZBGet's JSON RPC interface. See exposed methods below.

If you'd like new features, please open a GitHub issue or pull request.

Examples

Simple example to print some logs.

package main

import (
	"fmt"

	"golift.io/nzbget"
)

func main() {
	nzb := nzbget.New(&nzbget.Config{
		URL:  "http://nzbget.server.io:6789/",
		User: "userName",
		Pass: "passWord",
	})

	events, err := nzb.Log(0, 100)
	if err != nil {
		panic(err)
	}

	nzbVer, err := nzb.Version()
	if err != nil {
		panic(err)
	}

	fmt.Println("NZBGet Version: ", nzbVer)

	for _, event := range events {
		fmt.Println(event.ID, event.Kind, event.Time, event.Text)
	}
}
// Output:
// NZBGet Version:  21.1
// 47 INFO 2022-06-27 01:42:19 -0700 PDT Renaming 0b710bf619488ca0a1b5f83f53fde577.15 to eQ7Aq0DBEhHGCgSXy3PZ.part16.rar
// 103 INFO 2022-06-27 01:42:23 -0700 PDT Unrar: Extracting from eQ7Aq0DBEhHGCgSXy3PZ.part28.rar
// 104 INFO 2022-06-27 01:42:24 -0700 PDT Unrar: All OK
// 105 INFO 2022-06-27 01:42:24 -0700 PDT Deleting archive files
// 106 INFO 2022-06-27 01:42:24 -0700 PDT Deleting file eQ7Aq0DBEhHGCgSXy3PZ.part21.rar

Methods

Official NZBGet API reference can be found here.

All of these methods are exposed.

Program Control

Queue and History

Status, Logging and Statistics

Pause and Speed Limit

Configuration