You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gelbooru-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gelbooru-api

Unofficial NodeJS wrapper for gelbooru.com

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
31
1450%
Maintainers
1
Weekly downloads
 
Created
Source

⚡Unofficial NodeJS wrapper for gelbooru.com

N|Solid

Gelbooru has millions of free description hentai and rule34, anime videos, images, wallpapers, and more!

  • This library will allow you to:

  • Search posts with certain tags
  • Get post by id
  • Parse tags
  • Search users

Installation

npm i gelbooru-api

Methods

First you should initialize the Geelboru class, you can do it like this:

const Gelbooru = require(`gelbooru-api`);
const GelbooruClient = new Gelbooru(tags);

Now you can use library methods:

  • GelbooruClient.getPosts(tags,limit,pid)
  • GelbooruClient.getRandomPost(tags,limit,pid)
  • GelbooruClient.getTags(limit,orderBy,afterId)
  • GelbooruClient.searchTags(tags)
  • GelbooruClient.searchUser(name,limit)
  • GelbooruClient.getPostById(id)
  • GelbooruClient.getTagById(id)

⚠All these methods returns a Promise!

Examples

Download random post

const Gelbooru = require(`../index.js`);
const fs = require('fs');
const request = require('request');

const tags = 'yuri'; // provide tags here

const GelbooruClient = new Gelbooru(tags); // create new instance of Gelbooru

GelbooruClient.getRandomPost(tags, 10, 0).then(post => { // get random post
    const dw = request(post.file_url).pipe(fs.createWriteStream(`./${post.id}.jpg`)); // download post
    dw.on('finish', () => { // when download is finished
        console.log(`Downloaded ${post.id}`); // print post id
    }); 
})

Keywords

gelbooru

FAQs

Package last updated on 17 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts