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

YouTube player doesn't work, local file does #29

Open
UplinkPhobia opened this issue Sep 19, 2024 · 3 comments
Open

YouTube player doesn't work, local file does #29

UplinkPhobia opened this issue Sep 19, 2024 · 3 comments

Comments

@UplinkPhobia
Copy link

On launching a game, an error pops up in the console and no audio/video from YouTube can be played.
Local files seem to work fine.
The bug occurs on linux (manjaro), the windows version of the game seems to work fine (even on the same linux-hosted server, the windows client works but the linux one doesn't play the videos).
Happens even on a minimal version of the game with only this mod and dependencies.
No other error messages related to the mod are in the log.

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
OdinOnDemand.MPlayer.BasePlayer+<YoutubeNodeQuery>d__146.MoveNext () (at <88f056d3892f4267b61c97212708dde7>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <3aefadeb43334fcf8b7b268355c16be2>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
OdinOnDemand.MPlayer.BasePlayer:PlayYoutube(String)
OdinOnDemand.MPlayer.BasePlayer:RPC_SetURL(String, Boolean, Single)
OdinOnDemand.MPlayer.BasePlayer:<LoadZDO>b__153_1()
OdinOnDemand.MPlayer.<DelayedExecution>d__156:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

@Stonedprophet
Copy link

Same issue here.

[Error :OdinOnDemand.Utils.Net.Explode.Async+d__01[[YoutubeExplode.Videos.Streams.StreamManifest, YoutubeExplode, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]] Exception caught in ExecuteSafeAsync: System.Net.Http.HttpRequestException: 403 (Forbidden) at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x0002a] in <7b507295b5354781b67be2847e846b81>:0 at YoutubeExplode.Videos.Streams.StreamClient.TryGetContentLengthAsync (YoutubeExplode.Bridge.IStreamData streamData, System.String url, System.Threading.CancellationToken cancellationToken) [0x00117] in <1508ea30d4f84f1098963a2ce6c48e4f>:0 at YoutubeExplode.Videos.Streams.StreamClient+<GetStreamInfosAsync>d__6.MoveNext () [0x00265] in <1508ea30d4f84f1098963a2ce6c48e4f>:0 at System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore1[TResult].GetResult (System.Int16 token) [0x0001f] in <49e424219c4a4763a398a5192b431d03>:0
at YoutubeExplode.Videos.Streams.StreamClient+d__6.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult (System.Int16 token) [0x00000] in <1508ea30d4f84f1098963a2ce6c48e4f>:0
at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T] (System.Collections.Generic.IAsyncEnumerable1[T] source) [0x000e9] in <1508ea30d4f84f1098963a2ce6c48e4f>:0 at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T] (System.Collections.Generic.IAsyncEnumerable1[T] source) [0x001a7] in <1508ea30d4f84f1098963a2ce6c48e4f>:0
at YoutubeExplode.Videos.Streams.StreamClient.GetStreamInfosAsync (YoutubeExplode.Videos.VideoId videoId, YoutubeExplode.Bridge.PlayerResponse playerResponse, System.Threading.CancellationToken cancellationToken) [0x00124] in <1508ea30d4f84f1098963a2ce6c48e4f>:0
at YoutubeExplode.Videos.Streams.StreamClient.GetStreamInfosAsync (YoutubeExplode.Videos.VideoId videoId, System.Threading.CancellationToken cancellationToken) [0x00337] in <1508ea30d4f84f1098963a2ce6c48e4f>:0
at YoutubeExplode.Videos.Streams.StreamClient.GetManifestAsync (YoutubeExplode.Videos.VideoId videoId, System.Threading.CancellationToken cancellationToken) [0x00092] in <1508ea30d4f84f1098963a2ce6c48e4f>:0
at OdinOnDemand.Utils.Net.Explode.Async+<>c__DisplayClass1_0.b__0 (System.Threading.CancellationToken cancellationToken) [0x00091] in <88f056d3892f4267b61c97212708dde7>:0
at OdinOnDemand.Utils.Net.Explode.Async.ExecuteSafeAsync[T] (System.Func`2[T,TResult] operation, System.Threading.CancellationToken token) [0x0007b] in <88f056d3892f4267b61c97212708dde7>:0
[Error :OdinOnDemand.Utils.Net.Explode.URLGrab+d__16] Failed to get video manifest, check for exceptions
[Warning:OdinOnDemand.MPlayer.BasePlayer] Failed to load video

@Stonedprophet
Copy link

Also, I noticed the CFG file is empty?

@modestimpala
Copy link
Owner

Well @UplinkPhobia @Stonedprophet, I have some bad news.

After looking into this I've discovered that YouTube is really cracking down on Bots and changing their API massively.

See Tyrrrz/YoutubeExplode#794 and https://github.com/Tyrrrz/YoutubeExplode/releases/tag/6.4.2

YoutubeExplode 6.4.2 release notes state that "Due to the recent changes by YouTube, muxed streams are no longer provided. " - This mod only uses muxed streams. Even my website, https://dlp.lol/ is broken right now - and it uses an entirely different library called youtube-dlp.

I'm afraid to say it but this may be the end of Youtube integration in OdinOnDemand. Unless I somehow add cookie support, but apparently according to ytdl-org/youtube-dl#32905 (comment) cookies probably won't work for long if they even work at all. So not sure what direction to go here.

I still use youtube-dlp locally and it seems to work fine, so I might be able to switch over to that... but if muxed streams are gone entirely then we're in for a bad show.

That's all I really have for you folks right now. Sorry for the bad news, I wish Youtube would be more supportive, but ultimately they do not and never have wanted to support services like third party extractors so I am doubtful for the future.

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

3 participants