Imouto.BooruParser
3.2.5
See the version list below for details.
dotnet add package Imouto.BooruParser --version 3.2.5
NuGet\Install-Package Imouto.BooruParser -Version 3.2.5
<PackageReference Include="Imouto.BooruParser" Version="3.2.5" />
paket add Imouto.BooruParser --version 3.2.5
#r "nuget: Imouto.BooruParser, 3.2.5"
// Install Imouto.BooruParser as a Cake Addin #addin nuget:?package=Imouto.BooruParser&version=3.2.5 // Install Imouto.BooruParser as a Cake Tool #tool nuget:?package=Imouto.BooruParser&version=3.2.5
Imouto.BooruParser
The dotnet library for retrieving info from booru sites (chan.sankakucomplex.com, danbooru.donmai.us, yande.re, gelbooru.com). You can get individual posts, tags/notes history, and search by tags. Install as NuGet package:
Install-Package Imouto.BooruParser
<PackageReference Include="Imouto.BooruParser" Version="3.*" />
Version 3.2.0
- Added Rule34, they have a lot of tagged pay-walled staff and I will be using them as tag source for this stuff. No auth is required for now.
- Sankaku was broken once again. This time they changed their auth flow on their old site. PassHash no longer works. Without auth you also can't get all of post tags (only 20 general tags). I fixed it (only god know for how long). You have to provide login and password and it should work.
Version 3.1
Once again sankaku broke everything. It's now recommended to provide login and pass_hash for sankaku in order to receive all tags from posts. Without it you can only get 20 general tags.
Version 3.0
Have to increment major version due to breaking change in danbooru api usage. Now you have to provide your own user agent for your bot in danbooru settings, otherwise danbooru requests would fail with 403 (recent change on their side).
Version 2.0 released!
The new version of this library has been released. It's a complete rewrite and has a lot of breaking changes. Please don't update unless you're ready to spent some time in refactoring and reading.
The new version has gelbooru as partly supported booru. It doesn't provide a way to get tags or notes history, but you can search and retrieve posts by id or md5. To consume this library you should use IBooruApiLoader
interface. The library provides following implementations, one for each booru:
var loader = new DanbooruApiLoader(...);
var loader = new YandereApiLoader(...);
var loader = new SankakuApiLoader(...);
var loader = new GelbooruApiLoader(...);
The recommended way to consume them is to register them in your container:
services.AddBooruParsers();
// OPTIONAL
// It'ts nessesary for Sankaku auth management.
// You can skip it, if you don't plan to access sankaku with authorization.
services.AddMemoryCache();
But you can also register them yourself. You also need to provide configuration for booru if you want to have more relaxed limits:
services.Configure<DanbooruSettings>(Configuration.GetSection("Danbooru"));
services.Configure<GelbooruSettings>(Configuration.GetSection("Gelbooru"));
services.Configure<SankakuSettings>(Configuration.GetSection("Sankaku"));
services.Configure<YandereSettings>(Configuration.GetSection("Yandere"));
Each settings has PauseBetweenRequestsInMs
param which defines a pause between requests. 0 means you can run your requests in parallel and any positive number means that all requests would be called with the provided pause in ms between them. It's important to have some reserves to not get banned.
! Sankaku is a difficult case for the authorization. It requires access and refresh tokens (you can extract them from cookies), but refresh token has to be updated. So SankakuSettings
has a callback method SaveTokensCallbackAsync
that will be called, when it's necessary to update refresh and access tokens. It's you responsibility to store them somewhere and pass on the next application start.
Simplest usage
var loader = new DanbooruApiLoader(
new PerBaseUrlFlurlClientFactory(),
Options.Create(new DanbooruSettings()))
var post = await loader.GetPostAsync(5628013);
Console.WriteLine(post.Md5);
Version 1.x.x
Simplest usage
var username = "user";~~~~
var apiKey = "HBArbAk4WcKTSeAfsyBO";
var delayBetweenRequestsInMs = 1240;
var danbooruLoader = new DanbooruLoader(username, apiKey, delayBetweenRequestsInMs);
var post = await danbooruLoader.LoadPostAsync(5628013);
Console.WriteLine(post.Md5);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Flurl.Http (>= 4.0.0-pre2)
- HtmlAgilityPack (>= 1.11.46)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- System.IdentityModel.Tokens.Jwt (>= 6.30.1)
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 |
---|---|---|
3.4.1 | 147 | 5/20/2024 |
3.4.0 | 126 | 4/21/2024 |
3.3.0 | 143 | 1/25/2024 |
3.2.10 | 147 | 1/9/2024 |
3.2.9 | 216 | 12/6/2023 |
3.2.8 | 159 | 11/24/2023 |
3.2.7 | 191 | 10/29/2023 |
3.2.6 | 194 | 10/13/2023 |
3.2.5 | 170 | 10/3/2023 |
3.2.4 | 175 | 10/3/2023 |
3.2.3 | 161 | 10/2/2023 |
3.1.0 | 297 | 6/18/2023 |
3.0.2 | 195 | 6/5/2023 |
3.0.1 | 159 | 2/17/2023 |
2.0.6 | 158 | 12/28/2022 |
2.0.4 | 121 | 11/2/2022 |
2.0.3 | 130 | 10/30/2022 |
2.0.2 | 119 | 10/29/2022 |
1.18.1 | 564 | 9/17/2022 |
1.17.6 | 519 | 9/15/2022 |
1.17.5 | 482 | 9/15/2022 |
1.17.4 | 495 | 9/15/2022 |
1.17.3 | 497 | 9/15/2022 |
1.17.2 | 506 | 9/15/2022 |
1.17.1 | 508 | 9/15/2022 |
1.17.0 | 486 | 9/15/2022 |
1.16.1 | 497 | 9/8/2022 |
1.15.0 | 502 | 5/30/2022 |
1.14.1 | 512 | 5/2/2022 |
1.14.0 | 373 | 1/13/2022 |
1.13.0 | 349 | 1/11/2022 |
1.12.0 | 552 | 1/3/2021 |
1.11.0 | 655 | 5/2/2020 |
1.10.0 | 559 | 4/25/2020 |
1.9.0 | 773 | 2/7/2020 |
1.8.0 | 602 | 1/30/2020 |
1.7.0 | 647 | 12/3/2019 |
1.6.0 | 692 | 8/25/2019 |
1.5.0 | 633 | 8/25/2019 |
1.4.0 | 634 | 8/25/2019 |
1.3.0 | 707 | 3/16/2019 |
1.2.0 | 1,211 | 3/26/2018 |
1.1.0 | 1,104 | 3/25/2018 |
1.0.1 | 1,094 | 1/22/2018 |
1.0.0 | 1,142 | 9/15/2017 |