iBicha / UnityYoutubePlayer

Play YouTube videos in Unity
The Unlicense
338 stars 65 forks source link

KeyNotFoundException: The given key was not present in the dictionary. #20

Closed ojy999 closed 3 years ago

ojy999 commented 4 years ago

I'm not very good at this and have no idea what does this error means. The whole description looks like this.

KeyNotFoundException: The given key was not present in the dictionary. System.Text.Json.JsonElement.GetProperty (System.String propertyName) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) YoutubeExplode.ReverseEngineering.Responses.WatchPage+PlayerConfig.GetPlayerSourceUrl () (at <0c119db38ddd4963b87472d1b3ba0c1f>:0) YoutubeExplode.Videos.Streams.StreamsClient+<GetStreamContextFromWatchPageAsync>d__4.MoveNext () (at <0c119db38ddd4963b87472d1b3ba0c1f>:0) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at :0) YoutubeExplode.Videos.Streams.StreamsClient+d6.MoveNext () (at <0c119db38ddd4963b87472d1b3ba0c1f>:0) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at :0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at :0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at :0) System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at :0) YoutubePlayer.YoutubePlayer+d9.MoveNext () (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:63) UnityEngine.Debug:LogException(Exception) YoutubePlayer.d9:MoveNext() (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:80) System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception) YoutubeExplode.Videos.Streams.d6:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) YoutubeExplode.Videos.Streams.<GetStreamContextFromWatchPageAsync>d__4:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.ReverseEngineering.Responses.d9:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(WatchPage) YoutubeExplode.Internal.d11:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.ReverseEngineering.Responses.<b0>d:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(String) YoutubeExplode.ReverseEngineering.d6:MoveNext() UnityEngine.UnitySynchronizationContext:ExecuteTasks() `

Can someone help me out? Thank you so much.

ahmad4zan commented 4 years ago

i think the issue is resolved in YoutubeExplode 5.1.8 https://github.com/Tyrrrz/YoutubeExplode/issues/461

@iBicha can you update the Youtube package to 5.1.8?

ojy999 commented 4 years ago

@ahmad4zan Ah, thanks for replying, although I still have no idea how to resolve it... @iBicha need help! Thank you.

prasetion commented 4 years ago

same issue

ojy999 commented 4 years ago

So... I tried to look for the key that it said was not present, but I've checked everywhere and everything seems to be in place and nothing is missing.

prasetion commented 4 years ago

just like @ahmad4zan said, maybe we need to wait @iBicha update the youtube package. @ojy999 :)

ojy999 commented 4 years ago

@prasetion Seems like it... I hope he update soon tho. (internal crying)

jkchn commented 4 years ago

you can update it yourself by getting youtube explode and build dlls in visual studio -get youtubeexplode -open in vs -build youtubeexplode (ctrl b) -get the dlls (YoutubeExplode-master\YoutubeExplode\bin\Debug\net461) -put the dlls in the plugin folder in unity (Assets>YoutubePlayer>Plugins)

i am just as clueless as you so i cant help any further. i cant believe i figured all this out by myself!

kassarin commented 4 years ago

you can update it yourself by getting youtube explode and build dlls in visual studio -get youtubeexplode -open in vs -build youtubeexplode (ctrl b) -get the dlls (YoutubeExplode-master\YoutubeExplode\bin\Debug\net461) -put the dlls in the plugin folder in unity (Assets>YoutubePlayer>Plugins)

i am just as clueless as you so i cant help any further. i cant believe i figured all this out by myself!

I can't seem to open the solution in VS2019.

Can you upload the dlls to a friendly file sharing site?

ojy999 commented 4 years ago

you can update it yourself by getting youtube explode and build dlls in visual studio -get youtubeexplode -open in vs -build youtubeexplode (ctrl b) -get the dlls (YoutubeExplode-master\YoutubeExplode\bin\Debug\net461) -put the dlls in the plugin folder in unity (Assets>YoutubePlayer>Plugins)

i am just as clueless as you so i cant help any further. i cant believe i figured all this out by myself!

I just did, and it's working flawlessly again!! Thank you so much!!

kassarin commented 4 years ago

you can update it yourself by getting youtube explode and build dlls in visual studio -get youtubeexplode -open in vs -build youtubeexplode (ctrl b) -get the dlls (YoutubeExplode-master\YoutubeExplode\bin\Debug\net461) -put the dlls in the plugin folder in unity (Assets>YoutubePlayer>Plugins) i am just as clueless as you so i cant help any further. i cant believe i figured all this out by myself!

I can't seem to open the solution in VS2019.

Can you upload the dlls to a friendly file sharing site?

Nevermind, I solved this by updating VS2019. Thanks for solving this.

Edit: I think @iBicha has updated the project. Should be working now without going through the above.

prasetion commented 4 years ago

thank you everyone!!

jkchn commented 4 years ago

i forgot to mention one very important detail that it does not build the game! atleast on my unity. try check that out @ojy999

iBicha commented 3 years ago

This issue should be fixed now. If there's another issue, please open a separate issue. Thanks