Shiroechi / BooruDex

C# library to access booru public API.
MIT License
10 stars 3 forks source link

Using 2 tags at the same time via DanbooruDonmai got an error about the number of tags. #52

Closed AndryS0 closed 2 years ago

AndryS0 commented 2 years ago

Try to run this:

var a = new DanbooruDonmai();
var b = await a.GetRandomPostAsync(1, new string[] { "animated", "arknights" });

You'll get something like this

Unexpected error occured.
Status code = 422
Reason = Unprocessable Entity.

I don't know why, but when trying to GET /posts.xml?random=true&limit=1&tags=animated arknights it redirects you to /posts.xml?limit=1&tags=animated+arknights+random:1 and their API thinks that you are trying to find 3 tags instead of 2

AndryS0 commented 2 years ago

Oh.. it seems like they made "random" param as meta tag now request /post.xml?tag=tag1 tag2&limit=10&random=true should look like /post.xml?tag=random:10 tag1 tag2 (and using 3 tags are forbidden) It's now make it clear why I couldn't use two custom tags