newznab/torznab XML API client for Go (golang)
- TV and Movie search
- Search for files with category(s) and query
- Get comments for a NZB
- Get NZB download URL
- Download NZB
- Get latest releases via RSS
To install the package run go get github.com/mrobinsn/go-newznab
To use it in your application, import github.com/mrobinsn/go-newznab/newznab
client := newznab.New("http://my-usenet-indexer", "my-api-key", 1234, false)
Note the missing /api
part of the URL. Depending on the called method either /api
or /rss
will be appended to the given base URL. A valid user ID is only required for RSS methods.
caps, _ := client.Capabilities()
You will want to check the result of this to determine if your tracker supports searching by tvrage, imdb, tvmaze, etc.
categories := []int{
newznab.CategoryTVHD,
newznab.CategoryTVSD,
}
results, _ := client.SearchWithTVRage(categories, 35048, 3, 1)
categories := []int{
newznab.CategoryMovieHD,
newznab.CategoryMovieBluRay,
}
results, _ := client.SearchWithIMDB(categories, "0364569")
categories := []int{
newznab.CategoryTVHD,
newznab.CategoryTVSD,
}
results, _ := client.SearchWithTVMaze(categories, 80, 3, 1)
results, _ := client.SearchWithQueries(categories, "Oldboy", "movie")
results, _ := client.SearchWithQuery(categories, "", "movie")
results, _ := client.LoadRSSFeed(categories, 50)
results, _ := client.LoadRSSFeedUntilNZBID(categories, 50, "nzb-guid", 15)
Pull requests welcome.