1.1.0 • Published 4 years ago

nyaasiscrapper v1.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Nyaascrapper

npm version

Nyaascrapper is a simple tool to search and index nyaa.si

Installation

$ npm install nyaasiscrapper

Functions

functionuse
searchNyaamain function that allows to search with parameters nyaa.si, returns animeItem[]
advancedInfoSearches for advanced info that isn't on nyaa's rss feed, it has to query every page and scrape it so it might be slower

Using

searchNyaa()

const nyaa = require('nyaasiscrapper')
var search = nyaa.searchNyaa(searchOptions);
search.then((results) => console.dir(results))
searchOptions

Every argument is optional, if you don't specify any you'll get the equivalent of the main page.

propertytypemeaning
termstringthe term you want to search
categoryNyaa's categories, for more info go see the index.d.ts or the index.ts in github /srcA category of your choice
filter0,1,2No filter, no remake, trusted only
userstringsearch a user's only torrents
pagenumberan index of a page
sortTypego see the declaration too, also id == datewhat you want to sort torrents by
sortDirectionAscending, Descending, desc, ascin what direction you want to sort torrents
advancedbooleanwhen true it will search every page for more info so it will be slower

Advanced gets the description, the user, the files and the magnet, comments are a WIP.

getAdvancedInfos()

This function takes a animeItem or an array of them and returns it with more advanced infos.

animeItem

animeItem is the type of result you get using this module.

propertytypemeaning
titlestringTorrent title
categorystringcategory such as "English translated"
categoryIdstringcategoryId: '0_0' is all for example
downloadUrlstringTorrent file url
sizestringSize followed by unit
dateDateDate format of upload time
seedersnumberSeeder amount
leechersnumberLeecher amount
grabsnumberNumber of downloads
nyaaUrlstringUrl to nyaa page
infoHashstringInfohash of torrent
trustedbooleanWas the torrent uploaded by a trusted user?
remakebooleanIs the torrent a reupload?
description advancedstringDescription available on the torrent page
magnet advancedstringmagnet link
user advancedstringuploader
files advancedfile[]array of files that have a title, size and emplacement property
comments advancedcomment[]user, content, Date and edited boolean

TO DO

  • more tests

  • better error handling (pretty much non existent)