Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.98k stars 497 forks source link

GetVideoAuthorChannelAsync throws null reference exception #112

Closed WhiteLionATX closed 6 years ago

WhiteLionATX commented 6 years ago

Try the DemoWpf and scan this video: https://www.youtube.com/watch?v=mbD3z6SEp10 Ends in a null ref exception.

And there seems to be a second bug: I found this bug when trying to download the video executing this method: string videoId = "mbD3z6SEp10"; MediaStreamInfoSet streamInfoSet = await client.GetVideoMediaStreamInfosAsync(videoId);

EDIT: The bug above seems to aper on any video.

in one of ten cases it fails with this exception:

System.Threading.Tasks.TaskCanceledException: Eine Aufgabe wurde abgebrochen. bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei YoutubeExplode.Internal.HttpClientEx.<HeadAsync>d__2.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei YoutubeExplode.YoutubeClient.<GetVideoMediaStreamInfosAsync>d__40.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei System.Runtime.CompilerServices.TaskAwaiter 1.GetResult() bei Youtube_Uploader.Form1.<DownloadYoutubeVideo>d__183.MoveNext()

I ve no idea idea what causes this.

Tyrrrz commented 6 years ago

Confirmed, YouTube changed JSON structure of one of their responses.

Tyrrrz commented 6 years ago

Update: i just finished reading your post. I didn't manage to reproduce the second issue, only the first one.

WhiteLionATX commented 6 years ago

Thx for update! Btw: My "Edit" in the post belongs to the first bug. The second bug is still there ... I try to figure out what its caused by.

Tyrrrz commented 6 years ago

Please create a new issue if you find what is causing the other problem. I couldn't replicate it neither with tests nor DemoWpf.