Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentNullException: Value cannot be null. #5

Closed
mhadji05 opened this issue Sep 10, 2019 · 12 comments
Closed

ArgumentNullException: Value cannot be null. #5

mhadji05 opened this issue Sep 10, 2019 · 12 comments

Comments

@mhadji05
Copy link

Hello,

Some links is ok but with some others youtube links i take this error

e.g: https://www.youtube.com/watch?v=QKm-SOOMC4c

ArgumentNullException: Value cannot be null.

Parameter name: value
Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull (System.Object value, System.String parameterName) (at C:/Users/bhadriche/Desktop/Tag AR/Assets/JsonDotNet/JsonDotNet201Source~/Source/Newtonsoft.Json/Utilities/ValidationUtils.cs:38)
Newtonsoft.Json.Linq.Extensions.Value[T,U] (System.Collections.Generic.IEnumerable1[T] value) (at C:/Users/bhadriche/Desktop/Tag AR/Assets/JsonDotNet/JsonDotNet201Source~/Source/Newtonsoft.Json/Linq/Extensions.cs:174) Newtonsoft.Json.Linq.Extensions.Value[U] (System.Collections.Generic.IEnumerable1[T] value) (at C:/Users/bhadriche/Desktop/Tag AR/Assets/JsonDotNet/JsonDotNet201Source~/Source/Newtonsoft.Json/Linq/Extensions.cs:162)
YoutubeExplode.YoutubeClient+d__37.MoveNext () (at Assets/YoutubeExplode/YoutubeClient.Video.cs:80)
--- 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) YoutubeExplode.YoutubeClient+<GetVideoMediaStreamInfosAsync>d__41.MoveNext () (at Assets/YoutubeExplode/YoutubeClient.Video.cs:362) --- 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.YoutubePlayer+d__9.MoveNext () (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:64)
UnityEngine.Debug:LogException(Exception)
YoutubePlayer.d__9:MoveNext() (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:81)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) YoutubeExplode.<GetVideoMediaStreamInfosAsync>d__41:MoveNext() (at Assets/YoutubeExplode/YoutubeClient.Video.cs:588) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception)
YoutubeExplode.d__37:MoveNext() (at Assets/YoutubeExplode/YoutubeClient.Video.cs:190)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(IHtmlDocument)
YoutubeExplode.d__35:MoveNext() (at Assets/YoutubeExplode/YoutubeClient.Video.cs:58)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

@mhadji05
Copy link
Author

hi again,

Maybe i understand what happen. if the video is a different type of .mp4 fault parsed to googlevideo.
if you can help with that i appreciate it a lot.

thanks.

@mhadji05
Copy link
Author

Same issue here.
Here is the video link.
https://www.youtube.com/watch?v=iMSMnYI4gSM
@iBicha when can I expect the updated version?
Our team is using your plugin for our several projects and we should resolve this issue asap.

You need to convert your video to .mp4

@mhadji05
Copy link
Author

mhadji05 commented Nov 18, 2019

Sorry but i am not owner or co-owner of this project. I use this project to create something i need. I had the same problem. you can update the Youtube explode plugin and find the public static class Extensions.
On method below you can change the type of video you need or you can make some changes to create a universal tool for every type of video:

public static MuxedStreamInfo WithHighestVideoQualitySupported(this IEnumerable<MuxedStreamInfo> streamInfos)
        {
            if(streamInfos == null)
                throw new ArgumentNullException(nameof(streamInfos));
            return streamInfos
                .Where(info => info.Container == Container.Mp4)
                .Select(info => info).OrderByDescending(s => s.VideoQuality).FirstOrDefault();
        }

@iBicha
Copy link
Owner

iBicha commented Nov 18, 2019

Hi guys,
I apologize for lack of activity on my side. I've been a bit busy, I do plan on updating this repo and improve things, but I do not have an ETA.
Pull requests are more than welcome in the meantime. Cheers

@6ert
Copy link

6ert commented Nov 21, 2019

I would like to contribute, if not comments like @Top-Man's wouldnt keep me from doing so...

@Bitgamey
Copy link

I am also receiving the ArgumentNullException error, but I appreciate what you have done with this project so far. I wondered if it was the specific file format that might cause the error but I have 2 files (if you need examples) that are both MP4 and only 1 works, so I'm thinking maybe a specific codec is causing it?

Here are the 2 examples:
https://www.youtube.com/watch?v=pjnqfc3vQy4 (does work)
https://www.youtube.com/watch?v=6dzikBZTUy8 (doesn't work)

I will push forward including this in my project and hope it gets resolved soon! Thanks again.

@RC0D3
Copy link

RC0D3 commented May 3, 2020

It occurs because we need to decrypt some url video,the player do it...
If you see the json no have "url", only "cipher" with "s" and "url"...

see here more
https://stackoverflow.com/questions/21496126/android-youtube-download-url-403-forbidden

have 3 implemented modes, one in scala, one in python and one in csharp

In csharp is the best way, I think xD

@ZoraizQ
Copy link

ZoraizQ commented Jul 8, 2020

Any updates regarding this? Has the YoutubeExplode plugin been updated?

@iBicha
Copy link
Owner

iBicha commented Jul 16, 2020

I would like to comment on how this doesn't support all the videos:
Yes, Youtube have mixed encodings, not all videos are encoded the same way.
The check for the MP4 container is a rough failsafe to get a video that Unity can play.
To learn more about supported videos, you can check https://docs.unity3d.com/Manual/VideoSources-FileCompatibility.html

Finally, I've updated this package in #10 , feel free to try it and see if it solves your problem.
Cheers

@iBicha
Copy link
Owner

iBicha commented Dec 11, 2020

Please reopen issue if problem persists. thanks

@iBicha iBicha closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@6ert @iBicha @RC0D3 @mhadji05 @Bitgamey @ZoraizQ and others