Gelbooru has millions of free description hentai and rule34, anime videos, images, wallpapers, and more!
- Search posts with certain tags
- Get post by id
- Parse tags
- Search users
npm i gelbooru-api
const Gelbooru = require(`gelbooru-api`);
const GelbooruClient = new Gelbooru(tags);
- 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)
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
});
})