A Go module for parsing NZB files.
This is a fork of Tensai75's nzbparser, a library for parsing NZB files in Go.
NZB files are XML-based files that contain information necessary for downloading binary files from Usenet servers. This parser allows you to extract and work with that information programmatically.
go get github.com/javi11/nzbparserpackage main
import (
"fmt"
"github.com/javi11/nzbparser"
)
func main() {
// Parse an NZB file
nzb, err := nzbparser.ParseNZBFile("path/to/file.nzb")
if err != nil {
panic(err)
}
// Access NZB metadata
fmt.Println("NZB File:", nzb.Filename)
fmt.Println("Total Size:", nzb.Size)
fmt.Println("Number of files:", len(nzb.Files))
// Iterate through files in the NZB
for _, file := range nzb.Files {
fmt.Println("File:", file.Filename)
fmt.Println("Size:", file.Size)
}
}This project is licensed under the MIT License - see the original repository for details.
- Original implementation by Tensai75