meow

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

README

meow

Search nyaa (or any proxy/mirrors) with web scraping.

package main

import (
  "fmt"
  "vidhukant.com/meow"
)

func main() {
  q := meow.SearchQuery {
    SearchString: "mushishi",

    BaseURL: "nyaa.si", // default
    Filter: 0, // none (default)
    Category: meow.CategoryAll, // default
    Page: 1, // default (range 1-100)
  }

  res, err := meow.Search(q)
  if err != nil {
    panic(err)
  }

  for _, i := range res {
    fmt.Println(i.Title)
    fmt.Println(i.Category)
    fmt.Println(i.Flag)
    fmt.Println(i.URL)
    fmt.Println(i.TorrentURL)
    fmt.Println(i.MagnetURL)
    fmt.Println(i.FileSize)
    fmt.Println(i.TimeStamp)
    fmt.Println(i.Seeders)
    fmt.Println(i.Leechers)
    fmt.Println(i.Downloads)
  }
}

Available categories

Pretty self explanatory

  • CategoryAll

  • CategoryAnime

  • CategoryAnimeAMV

  • CategoryAnimeEnglish

  • CategoryAnimeNonEnglish

  • CategoryAnimeRaw

  • CategoryAudio

  • CategoryAudioLossless

  • CategoryAudioLossy

  • CategoryLiterature

  • CategoryLiteratureEnglish

  • CategoryLiteratureNonEnglish

  • CategoryLiteratureRaw

  • CategoryLiveAction

  • CategoryLiveActionEnglish

  • CategoryLiveActionIdolPV

  • CategoryLiveActionNonEnglish

  • CategoryLiveActionRaw

  • CategoryPictures

  • CategoryPicturesGraphics

  • CategoryPicturesPhotos

  • CategorySoftware

  • CategorySoftwareApps

  • CategorySoftwareGames

Available filters

  • FilterNone
  • FilterNoRemakes
  • FilterTrustedOnly

License

Licenced under GNU General Public Licence

GNU GPL License: LICENSE

Copyright (c) 2024 Vidhu Kant Sharma

Documentation

Index

Constants

View Source
const (
	FilterNone        int = 0
	FilterNoRemakes   int = 1
	FilterTrustedOnly int = 2
)

Variables

View Source
var (
	CategoryAll = Category{Category: 0, SubCategory: 0}

	CategoryAnime           = Category{Category: 1, SubCategory: 0}
	CategoryAnimeAMV        = Category{Category: 1, SubCategory: 1}
	CategoryAnimeEnglish    = Category{Category: 1, SubCategory: 2}
	CategoryAnimeNonEnglish = Category{Category: 1, SubCategory: 3}
	CategoryAnimeRaw        = Category{Category: 1, SubCategory: 4}

	CategoryAudio         = Category{Category: 2, SubCategory: 0}
	CategoryAudioLossless = Category{Category: 2, SubCategory: 1}
	CategoryAudioLossy    = Category{Category: 2, SubCategory: 2}

	CategoryLiterature           = Category{Category: 3, SubCategory: 0}
	CategoryLiteratureEnglish    = Category{Category: 3, SubCategory: 1}
	CategoryLiteratureNonEnglish = Category{Category: 3, SubCategory: 2}
	CategoryLiteratureRaw        = Category{Category: 3, SubCategory: 3}

	CategoryLiveAction           = Category{Category: 4, SubCategory: 0}
	CategoryLiveActionEnglish    = Category{Category: 4, SubCategory: 1}
	CategoryLiveActionIdolPV     = Category{Category: 4, SubCategory: 2}
	CategoryLiveActionNonEnglish = Category{Category: 4, SubCategory: 3}
	CategoryLiveActionRaw        = Category{Category: 4, SubCategory: 4}

	CategoryPictures         = Category{Category: 5, SubCategory: 0}
	CategoryPicturesGraphics = Category{Category: 5, SubCategory: 1}
	CategoryPicturesPhotos   = Category{Category: 5, SubCategory: 2}

	CategorySoftware      = Category{Category: 6, SubCategory: 0}
	CategorySoftwareApps  = Category{Category: 6, SubCategory: 1}
	CategorySoftwareGames = Category{Category: 6, SubCategory: 2}
)

Functions

This section is empty.

Types

type Category

type Category struct {
	Category    int
	SubCategory int
}

type Entry

type Entry struct {
	Flag       string
	Category   string
	Title      string
	URL        string
	TorrentURL string
	MagnetURL  string
	FileSize   string
	TimeStamp  string
	Seeders    int
	Leechers   int
	Downloads  int
}
func Search(q SearchQuery) ([]Entry, error)

type SearchQuery

type SearchQuery struct {
	BaseURL      string
	SearchString string
	Filter       int
	Category     Category
	Page         int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL