Skip to content

filvyb/nimbooru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nimbooru

A Nim library for searching and retrieving posts from multiple boorus.

Supported Sites

Gelbooru, Safebooru, Danbooru, Yandere, Konachan, E621, Sankaku, IdolComplex, Zerochan, Rule34Paheal

Installation

nimble install nimbooru

Usage

import nimbooru
import std/options

var client = initBooruClient(Safebooru)

# Search posts
let posts = client.searchPosts(limit = 20)
for post in posts:
  echo post.file_url

# Search with tags
let filtered = client.searchPosts(
  tags = some @["green eyes"],
  exclude_tags = some @["hat"]
)

# Get single post
let post = client.getPost("12345")

Async

import std/asyncdispatch

let posts = waitFor client.asyncSearchPosts(limit = 50)
let post = waitFor client.asyncGetPost("12345")

Authentication

var client = initBooruClient(
  Gelbooru,
  apiKey = some "key",
  userId = some "id"
)

Custom URL

var client = initBooruClient(
  "https://safebooru.donmai.us/",
  Danbooru
)

License

LGPL-3.0-or-later

About

Basic wrapper for APIs of various Boorus

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages