Error JsonReaderException when play Player scene
See original GitHub issueI have this error when i run the Player scene !
JsonReaderException: ‘a’ is an invalid start of a property name. Expected a ‘"’. LineNumber: 0 | BytePositionInLine: 1.
System.Text.Json.ThrowHelper.ThrowJsonReaderException (System.Text.Json.Utf8JsonReader& json, System.Text.Json.ExceptionResource resource, System.Byte nextByte, System.ReadOnlySpan1[T] bytes) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.Utf8JsonReader.ReadSingleSegment () (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.Utf8JsonReader.Read () (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.ReadOnlySpan
1[T] utf8JsonSpan, System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonDocument+MetadataDb& database, System.Text.Json.JsonDocument+StackRowStack& stack) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0)
System.Text.Json.JsonDocument.Parse (System.ReadOnlyMemory1[T] utf8Json, System.Text.Json.JsonReaderOptions readerOptions, System.Byte[] extraRentedBytes) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.ReadOnlyMemory
1[T] json, System.Text.Json.JsonDocumentOptions options) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0)
System.Text.Json.JsonDocument.Parse (System.String json, System.Text.Json.JsonDocumentOptions options) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0)
YoutubeExplode.Internal.Json.Parse (System.String source) (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0)
YoutubeExplode.Internal.Extensions.GenericExtensions.Pipe[TIn,TOut] (TIn input, System.Func2[T,TResult] transform) (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) YoutubeExplode.ReverseEngineering.Responses.WatchPage.TryGetPlayerConfig () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) YoutubeExplode.Videos.Streams.StreamClient+<GetStreamContextFromWatchPageAsync>d__4.MoveNext () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter
1[TResult].GetResult () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
YoutubeExplode.Videos.Streams.StreamClient+<GetManifestAsync>d__6.MoveNext () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0)
— End of stack trace from previous location where exception was thrown —
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) YoutubePlayer.YoutubePlayer+<PlayVideoAsync>d__9.MoveNext () (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:63) UnityEngine.Debug:LogException(Exception) YoutubePlayer.<PlayVideoAsync>d__9:MoveNext() (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:80) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1:SetException(Exception)
YoutubeExplode.Videos.Streams.<GetManifestAsync>d__6:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) YoutubeExplode.Videos.Streams.<GetStreamContextFromWatchPageAsync>d__4:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1:SetResult(WatchPage)
YoutubeExplode.ReverseEngineering.Responses.<GetAsync>d__10:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.Internal.<WrapAsync>d__1
1:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.ReverseEngineering.Responses.<<GetAsync>b__0>d:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1:SetResult(String)
YoutubeExplode.ReverseEngineering.<GetStringAsync>d__6:MoveNext()
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
Error occurs when running this line, YoutubePlayer.cs line 63: var streamManifest = await youtubeClient.Videos.Streams.GetManifestAsync(videoUrl);
Do you have an answer to this error?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (2 by maintainers)
Top GitHub Comments
Thank you. In the mean time I downloaded the YoutubeExplode Repository, recompiled it and put the dll in Assets/YoutubePlayer/Plugins/YoutubeExplode.dll. It seems to work well, at least for now
I have updated YoutubeExplode to 5.1.9, which should fix the issue.
It is simple actually. You can download the nuget package from https://www.nuget.org/packages/YoutubeExplode/, rename the file extension from .nupkg to .zip, extract, find the file lib/net461/YoutubeExplode.dll, and replace the file under Assets/YoutubePlayer/Plugins/YoutubeExplode.dll. If dependencies of the nuget package changes, dependencies need to be updated as well. There are nuget managers for Unity that could potentially do this cleanly, but I haven’t looked into this yet (since this repo is basically a prof-of-concept, nothing more).