iBicha / UnityYoutubePlayer

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

Exception: youtube-dl existed with code -1. #92

Closed MateuszKulis closed 1 year ago

MateuszKulis commented 1 year ago

Unity 2019.1.14f1 Windows 10

Code:

        async void OnEnable()
        {
            Debug.Log("Loading video...");
            await videoPlayer.PlayYoutubeVideoAsync("https://unity-youtube-dl-server.herokuapp.com/watch?v=1PuGuqpHQGo&cli=yt-dlp");
        }

Exception: youtube-dl existed with code -1.

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <7d97106330684add86d080ecf65bfe69>:0) YoutubePlayer.LocalYoutubeDl+<GetVideoMetaDataAsync>d__21[T].MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@2.0.0/Runtime/YoutubeDl/LocalYoutubeDl.cs:49) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <7d97106330684add86d080ecf65bfe69>:0) YoutubePlayer.YoutubeDl+<GetVideoMetaDataAsync>d__151[T].MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@2.0.0/Runtime/YoutubeDl/YoutubeDl.cs:64) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at <7d97106330684add86d080ecf65bfe69>:0) YoutubePlayer.VideoPlayerExtensions+d2.MoveNext () (at Library/PackageCache/com.ibicha.youtube-player@2.0.0/Runtime/VideoPlayerExtensions.cs:42) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at <7d97106330684add86d080ecf65bfe69>:0) Managers.VideoManager+d19.MoveNext () (at Assets/Scripts/Managers/VideoManager.cs:66) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <7d97106330684add86d080ecf65bfe69>:0) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) (at <7d97106330684add86d080ecf65bfe69>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnitySynchronizationContext.cs:115) UnityEngine.UnitySynchronizationContext:ExecuteTasks()

MateuszKulis commented 1 year ago

works after adding YoutubePlayer.cs to VideoPlayer component