iBicha / UnityYoutubePlayer

Play YouTube videos in Unity
The Unlicense
336 stars 63 forks source link

Exception: HTTP/1.1 400 Bad Request when trying to play a Youtube video #32

Closed markdimi closed 3 years ago

markdimi commented 3 years ago

Any idea what could be wrong? The same project was working a few days ago and now it's not. I put the latest version(1.3.1) and nothing still.

Exception: HTTP/1.1 400 Bad Request System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) YoutubePlayer.YoutubeDl+<GetVideoMetaDataAsync>d__51[T].MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@1.3.1/Runtime/YoutubeDl.cs:63) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) YoutubePlayer.YoutubePlayer+<GetRawVideoUrlAsync>d__8.MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@1.3.1/Runtime/YoutubePlayer.cs:52) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) YoutubePlayer.YoutubePlayer+d9.MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@1.3.1/Runtime/YoutubePlayer.cs:68) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) YoutubePlayer.YoutubePlayer+d10.MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@1.3.1/Runtime/YoutubePlayer.cs:91) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at <9577ac7a62ef43179789031239ba8798>:0) YoutubePlayer.YoutubePlayer+d7.MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@1.3.1/Runtime/YoutubePlayer.cs:39) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <9577ac7a62ef43179789031239ba8798>:0) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b6_0 (System.Object state) (at <9577ac7a62ef43179789031239ba8798>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0) UnityEngine.UnitySynchronizationContext:ExecuteTasks()

iBicha commented 3 years ago

400 is VERY LIKELY a missing url parameter. https://github.com/iBicha/youtube-dl-server/blob/9d0c43a4b9f8f7dba1c7a0a5615a06a8149adcaf/src/app.ts#L16

iBicha commented 3 years ago

I'm also seeing a few HTTP 429 Too Many Requests errors on the free instance. I will have to provide better logging so that developers have a better idea of what's going on.

markdimi commented 3 years ago

The missing URL makes sense, because the Youtube script isn't fetching the direct url to the video for the player.

iBicha commented 3 years ago

Updated the server and published 1.3.2 to make the error message more clear. You will see the error in Unity console (missing url, too many requests, etc) Let me know if this fixes the issue or helps narrow down the issue

Kavita315 commented 3 years ago

using version 1.3.2 plz help

Exception: HTTP/1.1 500 Internal Server Error ResponseError:{"error":"Command failed: /app/tools/bin/youtube-dl -f \"best\" --dump-json https://youtu.be/aJbYWaDfgf4\nERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by <HTTPError 429: 'Too Many Requests'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.\n","stderr":"ERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by <HTTPError 429: 'Too Many Requests'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.\n","stdout":""}

Screenshot 2021-02-01 at 10 49 13 AM
iBicha commented 3 years ago

Closing, please reopen or create new issue if needed, thanks