ZHANGTIANYAO1 / TS3AudioBot-NetEaseCloudmusic-plugin

这是一个用C#给TS3AudioBot编写网易云插件,让你的TS可以有一个音乐机器人。如果觉得好的话,还请给个星星支持一下

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

使用!yun gedan指令点播某些歌单时报错

salspica opened this issue · comments

报错信息:
An unexpected error occurred: '{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 33.

举例点播歌单名
!yun gedan FGSWYDGD

初步分析可能原因是歌单内曲目过多,粗略测试歌单列表两千首左右的就会触发报错,歌单列表五百首以下的能正常播放。

插件版本:2.0.3
播放模式:3 随机循环

插件更新前能正常播放列表2000首左右的歌单

请上传完整日志文件,在logs里面

请上传完整日志文件,在logs里面

2023-09-04 09:48:09.9538| INFO|0|Bot.OnMessageReceived User 发光三文鱼 requested: !yun gedan FGSWYDGD
2023-09-04 09:48:10.5457|ERROR|0|Bot.TryCatchCommand Unexpected command error: '{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 33.
System.Text.Json.JsonException: '{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 33.
---> System.Text.Json.JsonReaderException: '{' is invalid after a single JSON value. Expected end of data. LineNumber: 0 | BytePositionInLine: 33.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex) at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at YunPlgun.genList(Int64 id, ArrayList SongQueue, Ts3Client ts3Client) at YunPlgun.CommandGedan(String name, PlaylistManager playlistManager, ResolveContext resourceFactory, PlayManager playManager, InvokerData invoker, Ts3Client ts3Client, Player player) at TS3AudioBot.CommandSystem.Commands.FunctionCommand.ExecuteFunction(Object[] parameters) at TS3AudioBot.CommandSystem.Commands.FunctionCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments)
at TS3AudioBot.CommandSystem.BotCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments) at TS3AudioBot.CommandSystem.Commands.CommandGroup.Execute(ExecutionInformation info, IReadOnlyList1 arguments)
at TS3AudioBot.CommandSystem.Commands.CommandGroup.Execute(ExecutionInformation info, IReadOnlyList1 arguments) at TS3AudioBot.CommandSystem.Commands.RootCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments)
at TS3AudioBot.CommandSystem.CommandManager.Execute(ExecutionInformation info, String command)
at TS3AudioBot.Bot.<>c__DisplayClass42_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at TS3AudioBot.Bot.TryCatchCommand(ExecutionInformation info, Boolean answer, Func1 action) 2023-09-04 09:48:19.6023| INFO|0|Bot.OnMessageReceived User 发光三文鱼 requested: !next 2023-09-04 09:49:34.9953| INFO|0|Bot.OnMessageReceived User 发光三文鱼 requested: !yun gedan JOJI 2023-09-04 09:52:00.9845| INFO|0|Bot.OnMessageReceived User 发光三文鱼 requested: !yun gedan 也就两千首歌吧 2023-09-04 09:52:01.9969|ERROR|0|Bot.TryCatchCommand Unexpected command error: '{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 33. System.Text.Json.JsonException: '{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 33. ---> System.Text.Json.JsonReaderException: '{' is invalid after a single JSON value. Expected end of data. LineNumber: 0 | BytePositionInLine: 33. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker)
at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at YunPlgun.genList(Int64 id, ArrayList SongQueue, Ts3Client ts3Client)
at YunPlgun.CommandGedan(String name, PlaylistManager playlistManager, ResolveContext resourceFactory, PlayManager playManager, InvokerData invoker, Ts3Client ts3Client, Player player)
at TS3AudioBot.CommandSystem.Commands.FunctionCommand.ExecuteFunction(Object[] parameters)
at TS3AudioBot.CommandSystem.Commands.FunctionCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments) at TS3AudioBot.CommandSystem.BotCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments)
at TS3AudioBot.CommandSystem.Commands.CommandGroup.Execute(ExecutionInformation info, IReadOnlyList1 arguments) at TS3AudioBot.CommandSystem.Commands.CommandGroup.Execute(ExecutionInformation info, IReadOnlyList1 arguments)
at TS3AudioBot.CommandSystem.Commands.RootCommand.Execute(ExecutionInformation info, IReadOnlyList1 arguments) at TS3AudioBot.CommandSystem.CommandManager.Execute(ExecutionInformation info, String command) at TS3AudioBot.Bot.<>c__DisplayClass42_0.<<CallScript>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at TS3AudioBot.Bot.TryCatchCommand(ExecutionInformation info, Boolean answer, Func1 action)

emmm挺奇怪的,可能是json太大了,我得看看

查明原因了,是API问题,大佬共享出来的API似乎是有返回大小限制,歌单过大时无法返回JSON,请自行部署API再进行尝试,如果还是不行,请去网易云API的github项目反馈