Git Product home page Git Product logo

go-newznab's Introduction

go-newznab

GoDoc Go Report Card Build Status CircleCI codecov MIT license

newznab/torznab XML API client for Go (golang)

Documentation

GoDoc

Features

  • 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

Installation

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

Library Usage

Initialize a client:

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.

Get the capabilities of your tracker

caps, _ := client.Capabilities()

You will want to check the result of this to determine if your tracker supports searching by tvrage, imdb, tvmaze, etc.

Search using a tvrage id:

categories := []int{
    newznab.CategoryTVHD,
    newznab.CategoryTVSD,
}
results, _ := client.SearchWithTVRage(categories, 35048, 3, 1)

Search using an imdb id:

categories := []int{
    newznab.CategoryMovieHD,
    newznab.CategoryMovieBluRay,
}
results, _ := client.SearchWithIMDB(categories, "0364569")

Search using a tvmaze id:

categories := []int{
    newznab.CategoryTVHD,
    newznab.CategoryTVSD,
}
results, _ := client.SearchWithTVMaze(categories, 80, 3, 1)

Search using a name and set of categories:

results, _ := client.SearchWithQueries(categories, "Oldboy", "movie")

Get latest releases for set of categories:

results, _ := client.SearchWithQuery(categories, "", "movie")

Load latest releases via RSS:

results, _ := client.LoadRSSFeed(categories, 50)

Load latest releases via RSS up to a given NZB id:

results, _ := client.LoadRSSFeedUntilNZBID(categories, 50, "nzb-guid", 15)

Contributing

Pull requests welcome.

go-newznab's People

Contributors

mattsch avatar lsnow99 avatar imba3r avatar goraxe avatar mrobinsn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.