Grayjay.Desktop icon indicating copy to clipboard operation
Grayjay.Desktop copied to clipboard

"Provide Youtube Activity" does not provide any activity to YouTube

Open j-freimuth opened this issue 1 year ago • 11 comments

What happened?

With the official YouTube source enabled, logged in, and "Provide Youtube Activity" set to on:

actual behavior: Watch a video, go to YouTube in a web browser, check history, was not watched

expected behavior: Watch a video, go to YouTube in a web browser, check history, video should be watched.

System and Versions:

  • Fedora Version 40
  • Grayjay Version 2 Desktop stable

Grayjay Version

Desktop

What plugins are you seeing the problem on?

Youtube

Plugin Version

219

When do you experience the issue?

  • [X] While logged in
  • [ ] While logged out
  • [ ] N/A

Are you using a VPN?

No

Relevant log output

<log not active>

j-freimuth avatar Dec 27 '24 09:12 j-freimuth

Interesting, I unfortunately couldn't replicate this.

Zvonimir-FUTO avatar Dec 27 '24 19:12 Zvonimir-FUTO

Hmm, so it is probably on my side. Weird. I activated the logs and found this inside:

   --- Script error details follow ---
   Error: Connection refused
       at onInit (Script [3]:1088:21) -> 		const resp = http.GET(constructUrl(this.playbackUrlBase, this.getProgressParameters(this.playbackParams, seconds)),
DetailsController:Progress https://www.youtube.com/watch?v=9sTs00cK11A - 35094 - 34039 (PlaybackTracker: True)
DetailsController:Failed to call onProgress on PlaybackTracker: Error: Connection refused
Microsoft.ClearScript.ScriptEngineException: Error: Connection refused
 ---> Microsoft.ClearScript.ScriptEngineException: Error: Connection refused
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.AggregateException: One or more errors occurred. (Connection refused (s.youtube.com:443))
 ---> System.Net.Http.HttpRequestException: Connection refused (s.youtube.com:443)
 ---> System.Net.Sockets.SocketException (111): Connection refused
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Grayjay.Engine.Web.ManagedHttpClient.Request(String method, String url, Object body, Dictionary`2 headers)
   at Grayjay.Engine.Packages.PackageHttp.Request(RequestDescriptor descriptor)
   at Grayjay.Engine.Packages.PackageHttp.GET(String url, ScriptObject headers, Boolean auth, Boolean useByteResponses)
   at InvokeStub_PackageHttp.GET(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ClearScript.Util.InvokeHelpers.InvokeMethodInternal[T](IHostContext context, T method, Object target, Object[] args, Func`4 invoker, Type returnType, ScriptMemberFlags flags)
   at Microsoft.ClearScript.HostItem.InvokeMethod(String name, Object[] args, Object[] bindArgs)
   at Microsoft.ClearScript.HostItem.InvokeHostMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.InvokeMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, CultureInfo culture, Boolean bypassTunneling, Boolean& isCacheable)
   at Microsoft.ClearScript.HostMethod.TryInvoke(IHostContext context, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Object& result)
   at Microsoft.ClearScript.HostItem.InvokeHostMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.InvokeMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, CultureInfo culture, Boolean bypassTunneling, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.<>c__DisplayClass151_0.<InvokeReflectMember>b__0()
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyManaged.InvokeHostObject(IntPtr pObject, Boolean asConstructor, Int32 argCount, Ptr pArgs, Ptr pResult)
   --- End of inner exception stack trace ---
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke[T](Func`2 func)
   at Microsoft.ClearScript.V8.SplitProxy.V8ObjectImpl.InvokeMethod(String name, Object[] args)
   at Microsoft.ClearScript.V8.V8ScriptItem.<>c__DisplayClass10_0.<InvokeMethod>b__0()
   at Microsoft.ClearScript.ScriptEngine.ScriptInvokeInternal[T](Func`1 func)
   at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass137_0`1.<ScriptInvoke>b__0()
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyManaged.InvokeHostAction(IntPtr pAction)
   --- Script error details follow ---
   Error: Connection refused
       at onInit (Script [3]:1088:21) -> 		const resp = http.GET(constructUrl(this.playbackUrlBase, this.getProgressParameters(this.playbackParams, seconds)),
   --- End of inner exception stack trace ---
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke(Action`1 action)
   at Microsoft.ClearScript.V8.SplitProxy.V8ContextProxyImpl.InvokeWithLock(Action action)
   at Microsoft.ClearScript.V8.V8ScriptEngine.ScriptInvoke[T](Func`1 func)
   at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(Boolean marshalResult, String name, Object[] args)
   at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(String name, Object[] args)
   at Grayjay.Engine.Models.Playback.PlaybackTracker.OnInit(Double seconds)
   at Grayjay.Engine.Models.Playback.PlaybackTracker.OnProgress(Double seconds, Boolean isPlaying)
   at Grayjay.ClientServer.Controllers.DetailsController.WatchProgress(String url, Int64 position)
   --- Script error details follow ---
   Error: Connection refused
       at onInit (Script [3]:1088:21) -> 		const resp = http.GET(constructUrl(this.playbackUrlBase, this.getProgressParameters(this.playbackParams, seconds)),
DetailsController:Progress https://www.youtube.com/watch?v=9sTs00cK11A - 36152 - 35097 (PlaybackTracker: True)
DetailsController:Failed to call onProgress on PlaybackTracker: Error: Connection refused
Microsoft.ClearScript.ScriptEngineException: Error: Connection refused
 ---> Microsoft.ClearScript.ScriptEngineException: Error: Connection refused
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.AggregateException: One or more errors occurred. (Connection refused (s.youtube.com:443))
 ---> System.Net.Http.HttpRequestException: Connection refused (s.youtube.com:443)
 ---> System.Net.Sockets.SocketException (111): Connection refused
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Grayjay.Engine.Web.ManagedHttpClient.Request(String method, String url, Object body, Dictionary`2 headers)
   at Grayjay.Engine.Packages.PackageHttp.Request(RequestDescriptor descriptor)
   at Grayjay.Engine.Packages.PackageHttp.GET(String url, ScriptObject headers, Boolean auth, Boolean useByteResponses)
   at InvokeStub_PackageHttp.GET(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ClearScript.Util.InvokeHelpers.InvokeMethodInternal[T](IHostContext context, T method, Object target, Object[] args, Func`4 invoker, Type returnType, ScriptMemberFlags flags)
   at Microsoft.ClearScript.HostItem.InvokeMethod(String name, Object[] args, Object[] bindArgs)
   at Microsoft.ClearScript.HostItem.InvokeHostMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.InvokeMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, CultureInfo culture, Boolean bypassTunneling, Boolean& isCacheable)
   at Microsoft.ClearScript.HostMethod.TryInvoke(IHostContext context, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Object& result)
   at Microsoft.ClearScript.HostItem.InvokeHostMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.InvokeMember(String name, BindingFlags invokeFlags, Object[] args, Object[] bindArgs, CultureInfo culture, Boolean bypassTunneling, Boolean& isCacheable)
   at Microsoft.ClearScript.HostItem.<>c__DisplayClass151_0.<InvokeReflectMember>b__0()
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyManaged.InvokeHostObject(IntPtr pObject, Boolean asConstructor, Int32 argCount, Ptr pArgs, Ptr pResult)
   --- End of inner exception stack trace ---
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke[T](Func`2 func)
   at Microsoft.ClearScript.V8.SplitProxy.V8ObjectImpl.InvokeMethod(String name, Object[] args)
   at Microsoft.ClearScript.V8.V8ScriptItem.<>c__DisplayClass10_0.<InvokeMethod>b__0()
   at Microsoft.ClearScript.ScriptEngine.ScriptInvokeInternal[T](Func`1 func)
   at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass137_0`1.<ScriptInvoke>b__0()
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyManaged.InvokeHostAction(IntPtr pAction)
   --- Script error details follow ---
   Error: Connection refused
       at onInit (Script [3]:1088:21) -> 		const resp = http.GET(constructUrl(this.playbackUrlBase, this.getProgressParameters(this.playbackParams, seconds)),
   --- End of inner exception stack trace ---
   at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke(Action`1 action)
   at Microsoft.ClearScript.V8.SplitProxy.V8ContextProxyImpl.InvokeWithLock(Action action)
   at Microsoft.ClearScript.V8.V8ScriptEngine.ScriptInvoke[T](Func`1 func)
   at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(Boolean marshalResult, String name, Object[] args)
   at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(String name, Object[] args)
   at Grayjay.Engine.Models.Playback.PlaybackTracker.OnInit(Double seconds)
   at Grayjay.Engine.Models.Playback.PlaybackTracker.OnProgress(Double seconds, Boolean isPlaying)
   at Grayjay.ClientServer.Controllers.DetailsController.WatchProgress(String url, Int64 position)

This seems relevant. It seems to be a connection refused error. Not a not authenticated error. And my browser can update YouTube video progress, so my network is allowing it. I would have bet that it is something like a wrong URI, but that would affect you as well.

j-freimuth avatar Dec 28 '24 12:12 j-freimuth

I'm experiencing the same problem running on Mint. Youtube plugin version: 241

This might be related:

e DetailsController:Failed to get Playback tracker
Grayjay.Engine.Exceptions.ScriptException: Context structure not found (Line 3786, Col 19)
   at Grayjay.Engine.GrayjayPlugin.InterceptExceptions[T](Func`1 act, String script)
   at Grayjay.Engine.GrayjayPlugin.EvaluateRawObject(String script, Boolean nullable)
   at Grayjay.Engine.GrayjayPlugin.EvaluateObject[T](String js, Boolean nullable)
   at Grayjay.Engine.GrayjayPlugin.<>c__DisplayClass106_0.<GetPlaybackTracker>b__0()
   at Grayjay.Engine.GrayjayPlugin.WithIsBusy[T](Func`1 work)
   at Grayjay.Engine.GrayjayPlugin.GetPlaybackTracker(String url)
   at Grayjay.Desktop.POC.Port.States.StatePlatform.GetPlaybackTracker(String url)
   at Grayjay.ClientServer.Controllers.DetailsController.ChangeVideo(PlatformVideoDetails video, VideoLocal videoLocal)

TypicalScenario avatar Mar 21 '25 19:03 TypicalScenario

Could you guys try relogging to Youtube and check if that fixes it?

Zvonimir-FUTO avatar Aug 05 '25 11:08 Zvonimir-FUTO

Could you guys try relogging to Youtube and check if that fixes it?

After a relog, this time the client began reporting watch activity. Thanks for the fix.

TypicalScenario avatar Aug 15 '25 00:08 TypicalScenario

Could you guys try relogging to Youtube and check if that fixes it?

After a relog, this time the client began reporting watch activity. Thanks for the fix.

Same for me, thank you

j-freimuth avatar Aug 15 '25 05:08 j-freimuth

I still have this bug. GyJyDesktop doesn't add to history when I check youtube but mobile GrayJay is fine. I checked that it was enabled and also tried a mix and match of devices connected to each other and which device i was checking youtube history on.

Where are logs stored for Desktop? so I could add it here.

Mileside avatar Aug 28 '25 02:08 Mileside

@Mileside Try to logout and log back in to see if it fixes the issue.

Zvonimir-FUTO avatar Aug 28 '25 07:08 Zvonimir-FUTO

Truth be told after the recent plugin updates the application stopped reporting activity again. A relog now fixed it, but if I have to relog after every update... It's less than ideal.

TypicalScenario avatar Aug 28 '25 08:08 TypicalScenario

Still doesn't work after re-login for me. I also tried disabling the "Fallback with Player Script" in plugin settings since, according to description, "may improve compatibility at cost of ... possible tracking". I thought it would help but I'm not sure in what context does "tracking" mean.

Mileside avatar Aug 29 '25 01:08 Mileside

@Mileside Interesting that it is still bugged out. Could you double check that "Provide Youtube Activity" is enabled? If it is, please open a new bug report so we can triage it properly.

Zvonimir-FUTO avatar Aug 29 '25 07:08 Zvonimir-FUTO