Skip to content

Custom Booru

Christian Chaux edited this page Oct 2, 2019 · 4 revisions

If you want to use a Booru that isn't listed before, you can also instantiate a CustomBooru For example, let's say we want to create a custom Booru using Gelbooru website:

new BooruSharp.Booru.Custom.CustomBooru("gelbooru.com", UrlFormat.indexPhp, 20000, BooruOptions.noWiki, BooruOptions.noRelated);

The first argument must be the link to the domain name of the Booru.

The second argument is UrlFormat.indexPhp, UrlFormat.postIndexXml or UrlFormat.danbooru. It tells what the link to the API is.

The third argument is the number of images max. For example in Gelbooru, going further than the image 20000 in the API would result in an error, even if there are way more images available. It must be set to null if there is no maximum.

The other arguments are the options for the Booru:

  • BooruOptions.useHttp: The Booru don't accept https and must be accessed through http
  • BooruOptions.noWiki: The Booru don't have a wiki API
  • BooruOptions.noRelated: The Booru don't have a tag related API
  • BooruOptions.noComment: The Booru don't have a comment API
  • BooruOptions.noTagById: The Booru can't search for tags using an ID
  • BooruOptions.wikiSearchUseTitle: Searching by tag in this Booru use "title" instead of "query"