๐Ÿˆ๐Ÿ“ฆ nyaa.si client library for Go. Fetch Anime, Manga, Music and more torrents

๐Ÿˆ ๐Ÿ“ฆ go-nyaa

Go Reference Go Report Card

nyaa.si client library for Go

Built on top of:
gofeed - search using RSS
colly - scrap torrent details page

Original idea:
ejnshtein/nyaa-api

Installation ๐Ÿ”จ

go get github.com/mmcdole/gofeed
go get github.com/gocolly/colly
go get -u github.com/irevenko/go-nyaa

Contributing ๐Ÿค

Contributions, issues and feature requests are welcome! ๐Ÿ‘
Feel free to check open issues.

Docs ๐Ÿ“’

Go reference, Examples

Search Example

Search returns []Torrent

import ( 
	"fmt"
	"log"

	"github.com/irevenko/go-nyaa/nyaa"
)

func main() {
    opt := nyaa.SearchOptions{
        Provider: "nyaa", // Provider is the only required option
        Query:    "LN",
        Category: "literature",
        SortBy:   "seeders",
        Filter:   "trusted-only",
    }

    torrents, err := nyaa.Search(opt)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(torrents)
}

Search Options

type SearchOptions struct {
	Provider string
	Query    string
	Category string
	SortBy   string
	Filter   string
}

Provider

  • nyaa - nyaa.si
  • sukebei - sukebei.nyaa.si

Query

  • your desired search string

Category

nyaa

  • all - All Categories
  • anime - All Anime
    • anime-amv
    • anime-eng
    • anime-non-eng
    • anime-raw
  • audio - All Audio
    • audio-lossless
    • audio-lossy
  • literature - All Literature
    • literature-eng
    • literature-non-eng
    • literature-raw
  • live-action - All Live Action
    • live-action-idol-prom
    • live-action-eng
    • live-action-non-eng
    • live-action-raw
  • pictures - All Pictures
    • pictures-graphics
    • pictures-photos
  • software - All Software
    • software-apps
    • software-games

sukebei

  • all - All Categories
  • art - All Art
    • art-anime
    • art-doujinshi
    • art-manga
    • anime-games
    • anime-pictures
  • real-life - All Real Life
    • real-life-photos
    • real-life-videos

SortBy

  • comments
  • downloads
  • date
  • seeders
  • leechers
  • size

Filter

  • no-filter
  • no-remakes
  • trusted-only

TorrentComments

TorrentComments returns []Comment

import ( 
	"fmt"
	"log"
	
	"github.com/irevenko/go-nyaa/nyaa"
)

func main() {
	comms, err := nyaa.TorrentComments("https://nyaa.si/view/1366002") // nyaa.si or sukebei.nyaa.si
	if err != nil {
		log.Fatal(err)
	}

	for _, v := range comms {
		fmt.Println("user: " + v.User)
		fmt.Println("at: " + v.Date)
		fmt.Println("text: " + v.Text)
		fmt.Println()
	}
}

TorrentDescription

TorrentDescription returns string

import ( 
	"fmt"
	"log"

	"github.com/irevenko/go-nyaa/nyaa"
)

func main() {
	desc, err := nyaa.TorrentDescription("https://nyaa.si/view/1366002") // nyaa.si or sukebei.nyaa.si
	if err != nil {
		log.Fatal(err)
	}

   	fmt.Println(desc)
}

TorrentFiles

TorrentFiles returns []string

import ( 
	"fmt"
	"log"

	"github.com/irevenko/go-nyaa/nyaa"
)

func main() {
	files, err := nyaa.TorrentFiles("https://nyaa.si/view/1366002") // nyaa.si or sukebei.nyaa.si
	if err != nil {
		log.Fatal(err)
	}

	for _, v := range files {
		fmt.Println(v)
	}
}

Notes

  • Pagination does not work with RSS
  • Ascending sort does not work with RSS

Quick Start ๐Ÿš€

git clone https://github.com/irevenko/go-nyaa.git
cd go-nyaa
go get -d ./...
go run _examples/nyaa_search.go

What I Learned ๐Ÿง 

  • RSS Feed, xml
  • Parsing html in Go

License ๐Ÿ“‘

(c) 2021 Ilya Revenko. MIT License

Owner
Ilya Revenko
๐Ÿ—ป work work work ๐Ÿœ
Ilya Revenko
Similar Resources

fetch papers from p2p network

sci-hub P2P A project aims to fetch paper from the BitTorrent network. According to this Reddit post, currently, all `sci-hub's papers are available i

Dec 13, 2022

Small wrapper for containers/image which exposes a HTTP API to fetch

CLI to expose containers/image fetching via HTTP This is a small CLI program which vendors the containers/image Go library and exposes a HTTP API to f

Nov 1, 2021

fetch data from different databses

how to install make a folder with: - dbAgent.exe - config - log *config and log are folders make a config as mentioned below and put it inside config

Nov 22, 2021

It is a proxy to improve article readability, a directory for your favorite articles, and a way to make the internet lighter and more accessible.

timoneiro It is a work in progress. Some features are unimplemented yet. The helmsman's goal is to be a way to browse articles without all the distrac

Jun 13, 2022

Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021

A MCBE Proxy supporting fast transfer and much more!

A MCBE Proxy supporting fast transfer and much more!

Downloads Pipelines Here you can find all the build please select the latest and click Artifacts

Oct 17, 2022

Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.

Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.

Jan 7, 2023

red-tldr is a lightweight text search tool, which is used to help red team staff quickly find the commands and key points they want to execute, so it is more suitable for use by red team personnel with certain experience.

red-tldr is a lightweight text search tool, which is used to help red team staff quickly find the commands and key points they want to execute, so it is more suitable for use by red team personnel with certain experience.

Red Team TL;DR English | ไธญๆ–‡็ฎ€ไฝ“ What is Red Team TL;DR ? red-tldr is a lightweight text search tool, which is used to help red team staff quickly find t

Jan 5, 2023
Related tags
Torrent client designed for seeding tens of thousands of torrents.

Gamayun This project is currently a prototype. It is not usable in any shape or form. One day, this will be an efficient BitTorrent client, handling l

Jul 27, 2022
Go-fetch-words - Fetch 5 letter words from dictionary.com

Go-fetch-words This GO app fetches 5 letter words from dictionary.com and saves

Oct 16, 2022
Fetch-npm-package - A small utility that can be used to fetch a given version of a NPM package

Use fetch-npm-package <package> <version> <output-dir> E.g. fetch-npm-package is

May 21, 2022
๐Ÿˆ๐ŸŒ nyaa.si terminal BitTorrent tracker
๐Ÿˆ๐ŸŒ nyaa.si terminal BitTorrent tracker

koneko - TUI Client for nyaa.si ?? ?? Download Anime, Literature, Audio, Live Action, Pictures, Software Data - go-nyaa TUI - tview Installation ?? go

Dec 30, 2022
๐ŸŒ• Server application for storing doujinshi, manga, art collections and other galleries with API and user control. Written in Go.

?? Server application for storing doujinshi, manga, art collections and other galleries with API and user control. Written in Go.

Dec 31, 2022
torsniff - a sniffer that sniffs torrents from BitTorrent network

torsniff - a sniffer that sniffs torrents from BitTorrent network English | ็ฎ€ไฝ“ไธญๆ–‡ Introduction torsniff is a torrent sniffer, it sniffs torrents that p

Dec 27, 2022
search yts.mx for torrents

movies - search yts.mx for torrents install: go build && sudo mv movies /usr/local/bin --query QUERY, -q QUERY QUERY to search --rating RAT

Oct 6, 2022
unofficial Manganato's manga downloader CUI written in Go
unofficial Manganato's manga downloader CUI written in Go

manganato-cli Unofficial Manganato's manga downloader CUI and CLI written in Go. note: currently works on Mac and Linux, for Windows, please run via D

Nov 8, 2022
A Go client used to fetch information from the Go API

Hilo Client Go Hilo API Go client, Introduction This is a (partial) Go client used to fetch information from the Go API, most of the reverse engineeri

Nov 27, 2021
fetch and serve papers in p2p network

sci-hub P2P A project aims to fetch paper from the BitTorrent network. This is not a cli client of sci-hub website. English Introduction ไธญๆ–‡็ฎ€ไป‹ Contribu

Dec 13, 2022