-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safebooru doesn't appear to be working for me #52
Comments
Also just wanted to say that your API is amazing and easy to use! Thanks <3 |
Hey, thanks for the bug report, could you please tell me which version of the library you are using? |
i pulled the latest i could find on nuget. looks like 4.0.0-beta? |
I rolled back to 3.6.0 and Safebooru works! TY |
Good to know, I'll still have a look at beta to see if I can do something, thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var booru = new BooruSharp.Booru.Safebooru();
PostSearchResult? result = null;
try
{
result = await booru.GetRandomPostAsync();
}
catch (Exception e)
{
Console.WriteLine(e);
}
Throws this exception:
System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $[0].directory | LineNumber: 0 | BytePositionInLine: 336.
---> System.InvalidOperationException: Cannot get the value of a token type 'Number' as a string.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
at System.Text.Json.Utf8JsonReader.GetString()
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable
1 actualByteCount)at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 json, JsonTypeInfo
1 jsonTypeInfo)at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at BooruSharp.Booru.ABooru.GetDataAsync[T](Uri url)
at BooruSharp.Booru.Template.Gelbooru02.GetPostSearchResultAsync(Uri uri)
at BooruSharp.Booru.ABooru.GetRandomPostAsync(String[] tagsArg)
The text was updated successfully, but these errors were encountered: