BooruSharp 3.0.2
BooruSharp is a C# library to browse Booru websites (Gelbooru, Konachan, etc...) easily
Install-Package BooruSharp -Version 3.0.2
dotnet add package BooruSharp --version 3.0.2
<PackageReference Include="BooruSharp" Version="3.0.2" />
paket add BooruSharp --version 3.0.2
#r "nuget: BooruSharp, 3.0.2"
BooruSharp
BooruSharp is a C# library to browse Booru websites easily<br/>
You can download it from NuGet:
Install-Package BooruSharp
Install-Package BooruSharp.Others
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
BooruSharp.Others allow to handle more websites that aren't booru:
- pixiv.net
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); })));
Want to contribute
Feel free to open a pull request.
Need more help
Feel free to open an issue or come ask on Discord.
BooruSharp
BooruSharp is a C# library to browse Booru websites easily<br/>
You can download it from NuGet:
Install-Package BooruSharp
Install-Package BooruSharp.Others
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
BooruSharp.Others allow to handle more websites that aren't booru:
- pixiv.net
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); })));
Want to contribute
Feel free to open a pull request.
Need more help
Feel free to open an issue or come ask on Discord.
Dependencies
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
Used By
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BooruSharp:
Package | Downloads |
---|---|
BooruSharp.Others
Extension of BooruSharp to handle non-booru websites and handle them like the others
|
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
3.0.2 | 167 | 2/5/2021 |
3.0.1 | 487 | 11/17/2020 |
3.0.0 | 140 | 11/12/2020 |
2.11.0 | 710 | 9/7/2020 |
2.10.0 | 571 | 8/18/2020 |
2.9.0 | 514 | 8/17/2020 |
2.8.1 | 183 | 8/17/2020 |
2.8.0 | 338 | 8/2/2020 |
2.7.0 | 305 | 7/9/2020 |
2.6.1 | 141 | 7/8/2020 |
2.6.0 | 127 | 7/8/2020 |
2.5.0 | 128 | 7/7/2020 |
2.4.0 | 114 | 7/6/2020 |
2.3.1 | 189 | 6/23/2020 |
2.3.0 | 169 | 6/22/2020 |
2.2.0 | 122 | 6/22/2020 |
2.1.0 | 197 | 6/4/2020 |
2.0.3 | 677 | 3/24/2020 |
2.0.2 | 168 | 3/24/2020 |
2.0.1 | 162 | 3/23/2020 |
2.0.0 | 185 | 3/21/2020 |
1.4.8 | 302 | 2/21/2020 |
1.4.7 | 206 | 1/31/2020 |
1.4.6 | 266 | 9/24/2019 |
1.4.4 | 626 | 8/1/2019 |
1.4.3 | 320 | 7/13/2019 |
1.4.2 | 462 | 5/30/2019 |
1.4.1 | 527 | 4/8/2019 |
1.4.0 | 376 | 2/27/2019 |
1.3.6 | 545 | 1/10/2019 |
1.3.5 | 414 | 1/5/2019 |
1.3.3 | 537 | 10/17/2018 |
1.3.1 | 459 | 8/21/2018 |
1.3.0 | 483 | 8/14/2018 |
1.2.0 | 476 | 7/31/2018 |
1.1.1 | 460 | 7/30/2018 |
1.1.0 | 464 | 7/27/2018 |
1.0.1 | 498 | 7/22/2018 |