BooruSharp.Others 1.0.0-beta

This is a prerelease version of BooruSharp.Others.
There is a newer version of this package available.
See the version list below for details.
dotnet add package BooruSharp.Others --version 1.0.0-beta                
NuGet\Install-Package BooruSharp.Others -Version 1.0.0-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BooruSharp.Others" Version="1.0.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BooruSharp.Others --version 1.0.0-beta                
#r "nuget: BooruSharp.Others, 1.0.0-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BooruSharp.Others as a Cake Addin
#addin nuget:?package=BooruSharp.Others&version=1.0.0-beta&prerelease

// Install BooruSharp.Others as a Cake Tool
#tool nuget:?package=BooruSharp.Others&version=1.0.0-beta&prerelease                

NuGet Nuget | GitHub CI | AppVeyor CI | | -------------- | ------------ | | Build (GitHub CI) | Build (AppVeyor) |

codecov Unit tests CodeFactor

BooruSharp

BooruSharp is a C# library to browse Booru websites easily<br/> You can download it from NuGet:

Install-Package BooruSharp

BooruSharp currently handle the following websites:

  • booru.allthefallen.moe
  • danbooru.donmai.us
  • e621.net
  • e926.net
  • furry.booru.org
  • gelbooru.com
  • konachan.com
  • lolibooru.moe
  • realbooru.com
  • rule34.xxx
  • safebooru.org
  • sakugabooru.com
  • beta.sankakucomplex.com
  • xbooru.com
  • yande.re

Documentation

Version >= 2.0.0: https://boorusharp.zirk.eu/<br/> Version ⇐ 1.4.8: https://github.com/Xwilarg/BooruSharp/wiki<br/> Transition from 1.4.8 to 2.0.0: https://boorusharp.zirk.eu/transition.html

Features availability

Booru Multiple Random Images Post by ID Post by MD5 Tag by ID Comment API Last Comments API Wiki API Related Tag API Post Count API Favorite API
Atfbooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Danbooru Donmai ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
E621 ✔️ ✔️
E926 ✔️ ✔️
Furry Booru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Gelbooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Konachan ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Lolibooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Realbooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Rule 34 ✔️ ✔️ ✔️ ✔️
Safebooru ✔️ ✔️ ✔️ ✔️
Sakugabooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Sankaku Complex ✔️ ✔️ ✔️ ✔️ ✔️
Xbooru ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Yandere ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Pixiv ✔️ ✔️

Examples

Random image:

BooruSharp.Booru.Gelbooru booru = new BooruSharp.Booru.Gelbooru();
BooruSharp.Search.Post.SearchResult result = await booru.GetRandomPostAsync("hibiki_(kantai_collection)", "school_swimsuit");

Console.WriteLine("Image preview URL: " + result.previewUrl.AbsoluteUri + Environment.NewLine +
                  "Image URL: " + result.fileUrl.AbsoluteUri + Environment.NewLine +
                  "Image is safe: " + (result.rating == BooruSharp.Search.Post.Rating.Safe) + Environment.NewLine +
                  "Tags on the image: " + String.Join(", ", result.tags));

Get many random images at once:

BooruSharp.Booru.SankakuComplex booru = new BooruSharp.Booru.SankakuComplex();
BooruSharp.Search.Post.SearchResult[] result = await booru.GetRandomPostsAsync(10, "ifrit_(arknights)", "silence_(arknights)");

Console.WriteLine(string.Join(Environment.NewLine, result.Select(x => "Random Image: " + x.fileUrl)));

Get tag:

BooruSharp.Booru.Safebooru booru = new BooruSharp.Booru.Safebooru();
BooruSharp.Search.Tag.SearchResult result = await booru.GetTagAsync("cirno");

Console.WriteLine("Tag type: " + result.type + Environment.NewLine +
                  "ID: " + result.id);

Get Wiki entry:

BooruSharp.Booru.Konachan booru = new BooruSharp.Booru.Konachan();
BooruSharp.Search.Wiki.SearchResult result = await booru.GetWikiAsync("loli");

Console.WriteLine("Description: " + result.body + Environment.NewLine +
                  "ID: " + result.id + Environment.NewLine +
                  "Created at: " + result.creation.ToString("dd/MM/yy HH:mm:ss") + Environment.NewLine +
                  "Last update at: " + result.lastUpdate.ToString("dd/MM/yy HH:mm:ss"));

Get related tags:

BooruSharp.Booru.Yandere booru = new BooruSharp.Booru.Yandere();
BooruSharp.Search.Related.SearchResult[] results = await booru.GetRelatedAsync("see_through");

Console.WriteLine(String.Join(Environment.NewLine,
    results.Select(delegate (BooruSharp.Search.Related.SearchResult res) { return ("Name: " + res.name +" (" + res.count + ")"); })));

Get comments:

BooruSharp.Booru.Lolibooru booru = new BooruSharp.Booru.Lolibooru();
BooruSharp.Search.Comment.SearchResult[] results = await booru.GetCommentAsync(134097);

Console.WriteLine(String.Join(Environment.NewLine,
    results.Select(delegate (BooruSharp.Search.Comment.SearchResult res) { return ("Author: " + res.authorName + ", the " + res.creation.ToString("dd/MM/yy HH:mm:ss") + " - " + res.body); })));

Add to favorite:

BooruSharp.Booru.Safebooru booru = new BooruSharp.Booru.Safebooru();
booru.SetBooruAuth(new BooruSharp.Booru.BooruAuth("yourUserId", "yourPasswordHash")); // See https://boorusharp.zirk.eu/#authentification
await booru.AddFavoriteAsync(1759793);

Get all character tags containing a string:

BooruSharp.Booru.Yandere yandere = new BooruSharp.Booru.Yandere();
BooruSharp.Search.Tag.SearchResult[] results = await yandere.GetTagsAsync("tsukiko");
Console.WriteLine(String.Join(Environment.NewLine,
	results.Where(delegate (BooruSharp.Search.Tag.SearchResult res) { return (res.type == BooruSharp.Search.Tag.TagType.Character); })
           .Select(delegate (BooruSharp.Search.Tag.SearchResult res) { return (res.name); })));

Need more help?

Feel free to open an issue or come ask on Discord.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.1 10,239 9/5/2022
2.2.0 1,131 5/22/2021
2.1.0 831 5/21/2021
2.0.0 954 11/12/2020
1.4.0-beta 829 9/7/2020
1.3.0-beta 810 8/18/2020
1.2.0-beta 831 8/13/2020
1.1.1-beta 847 8/12/2020
1.1.0-beta 755 8/12/2020
1.0.0-beta 849 8/2/2020