-
Notifications
You must be signed in to change notification settings - Fork 7
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 ads neither skipped nor muted on CC with Google TV #27
Comments
Interesting. I'm also using a Chromecast with Google TV and it worked last I checked...hopefully something didn't change in the Cast API. I'll see if I can replicate this! Could you set |
Log only shows the continuous |
Thanks, that's helpful. Sounds like ads aren't being detected for your device. Still planning to try to replicate! |
I got the same issue when testing. This is the log I got (with actual video title removed though, but it was the title of the video I watched, so it detected it) My comments inline for what I did
I'm testing with:
It also seems to not continue to log when changing to a new video, and the logging of "Searching for video ID " seems to be more seldom. So seems like it gets stuck somewhere |
I've been doing some testing and so far ad skip works reliably on a Chromecast Ultra and a Nest Hub. I don't think this is due to the device type, but I have another thought. @pengi Thanks for the log and the extra info! Your log made me realize the retry logic for the YouTube search might be getting in the way of ad skip. When a video is found, it will log the video information, but that never happened here. Instead, it kept retrying the search. This is currently expected: if the YouTube search fails, it will pause the update cycle and retry up to 10 times with an exponential backoff. Could you let that search happen 10 times and see if an error is printed? It seems like I should improve the retry logic, and I should also log the first error instead of waiting for the last. I may change it to just log every error. That could get chatty but I think more info would have more easily shown what's going on here. |
I just found a couple more bugs that could be contributing to this:
I'll fix all of this and release an update soon. Hopefully it helps 🤞 |
Yeah, it definitely looks like exponential backoff, and it seems to stop after 10 times. But no comment afterwards. I'm trying to setup a go development environment here too to see if I can investigate a bit myself, but meanwhile, here is the log.
I also have a run where the "ignoring device" happened before the last "searching for video id"
In both runs, the retries was longer than the video clip itself, so had to scroll back a couple of times during playback, but that didn't seem to reset anything for what I could tell... but not sure. |
@pengi The "ignoring device" log is unrelated. That gets logged when a device is discovered that already has an active connection. |
I got the go enviornment up and running and found the error. Added some logging:
and got:
Or slightly easier formatted:
So when I simply enabled the YouTube v3 API for my API key it started working. Think it's a case of error handling and reporting for API responses, to be helpful with outputs to point users towards how to fix it. So now it works fine, thanks for the tool :) |
Assumed so :) was thinking if if wasn't multitheaded, it could be helpful to know if the retry code had exited, or something similar |
I just pushed an update to run the YouTube search and the SponsorBlock queries concurrently so that ad skip doesn't get blocked. It isn't released yet, but it will be soon 🙂 This update will also improve YouTube API logging.
It actually is multithreaded! Discovery and the update flow for each device all run independently of each other. |
Sorry for the noise. I committed these changes in a single commit then decided to split them up |
Youtube ads still don't get muted or skipped. In-video ad also didn't get skipped here.
Can provide debug logs later. |
It worked for me in v0.5.0 when I activated the API key actually. But now on v0.5.1, I get somewhat better error reporting (well, I get the raw output from google API) when I don't have the key active, but I get the same error as @schumi4 when I activate the key again
|
Hum... tried to checkout and rebuild from source, and get this, but doesn't work in tag v0.5.1:
But when checking out v0.5.0 I get:
run.sh is just a script that sets up environment and rebuilds |
I did a git bisect, and ended up on this commit introducing the error: a0de9b7 What I noticed is later versions with problems are missing:
And that output seems to correspond to when it works or not |
With "when it works", do you mean skipping in-video sponsors or skipping and muting the pre/mid-roll youtube ads? |
Oh right, sorry... I guess I forget about the pre/mid-roll youtube ads, since I have premium. Good call. I can only test in-video sponsors here, so that works for me. Which means the code for detecting and searching for the videos. |
This might however still be related. Seeing as the evidence (very small sample size i'll admit lol) points to newer devices not having the ads muted. These are also the ones who require the whole API-key ordeal in the first place. From my testing: EDIT:
|
@schumi4 I wish I had one of these newer devices so that I could test some of this strange behavior myself. Instead, you might install vishen/go-chromecast so that you can see what some of the fields are set to that differs from older devices. I'm not sure if it will give all of the data we need yet. I'll keep you posted |
@schumi4 If you install go-chromecast, can you run the command below, then choose your device and let an ad play? I'd love to see what gets logged. It could also be helpful if you can capture a log when the YouTube search fails. The command is: go-chromecast watch --debug |
I certainly can! This case however is at a friend's house so I'll have to remote in sometime next week. Maybe someone else with local access and the same issue can jump in? Optimistic we can get this fixed though! |
With a heavy heart I have transistioned this case to use iSponsorBlockTV. While I dislike the bloated feel and having to run it with docker, it works for this use case. Sticking with CSS for my local install though. |
@schumi4 were you ever able to grab the device status with go-chromecast? I believe I know why this is happening but unfortunately I don't have a newer Chromecast to test. I think the status field may be getting set to another number while an ad is playing. Edit: Oh and for the video lookup, I have a feeling the fields may just be set with different names |
Hey @gabe565, maybe I can help with my Chromecast with Google TV. Having the samen problems as reported by schumi4. Example output from go-chromecast while running below. It does not seem too interesting to me, but maybe it can help you out?
Additionally, output from CastSponsorSkip (a different moment/video) when the search fails:
Hope this helps, let me know if I can contribute anything else! |
@BasVanBoven Thank you so much! Did you grab that while an ad was playing? There should be a field called |
I am afraid it has been removed. I just tested again with a larger piece of log attached, but no mention of customData anywhere. When I have more time, I will try and look into the way iSponsorBlockTV handles CCwGTVs (that one is working fine). |
I think I have the same setup as @pengi - Google TV with a Premium subscription. Exactly the same result, 0.5.3 never skips any segments - 0.5.0 does work as expected. |
@taviso Thanks for bringing that to my attention again. I thought it had been fixed, but seems like there are still some issues. Investigating now! |
For some reason the search query is being built as Edit: Nevermind. I can't see how that would happen, that may have just been @pengi editing out the actual content. Let me compare logs some more |
I unfortunately can't neither deny nor confirm at this point, since I get errors also on my computer. Seems that the sponsorblock API service is down. When checking it manually, I get cloudflare error code 502, at least from my location. Therefore, I don't know if that happens also to CastSponsorSkip. The log is at least:
while standing on b182a21 Not that I'm not used to go, so at this point I have to guess a bit of how to build. I checked out that version, then ran:
So I hope that should rebuild everything. That being said, it could equally well just be the sponsorblock api this time. Unfortunately, this was probably the last time in like 2 months I can check it since I'm moving, and I'll take the TV with chromecast to one spot in an hour, and my computer in the other for a while. |
@pengi Thank you for testing. You helped me realize there was one final issue, but that one has also been fixed! I also tested with a friend's device which requires API lookups, and it's working great after my most recent commit! |
Can confirm the issue is present on youtube app with Onn 4k tv box, and chromecast HD |
I also can confirm the issue still present as of .7.2 build, on youtube app with Onn 4k tv box (Google TV) |
Can anyone see if this is improved with v0.7.3? I found some cast events which were being filtered, causing CastSponsorSkip to not catch the playing state until after the ad had finished. I'm hoping this fix will help 🤞 |
Sadly, neither mute nor auto-skip are yet working with v0.7.3 when tested with the Onn 4k tv box (Google TV). Thank you for trying - CastSponsorSkip works great on my older Chromecast devices! |
Yeah, the skip and mute functionality does not work with my new chrome cast either. Howvever, ISponsorBlockTv works. Although, it uses the texted based setup and does not say where the device ip/id is stored whereas CSS stores everything in the docker file. This is what appears in the CSS logs for me when running it via Docker: 2024-08-24 11:19:39 INF CastSponsorSkip version=v0.8.0 commit=9e65ac39 |
Yeah it seems Google has changed something in newer devices so that they don't expose when an ad is playing. I have YouTube Premium, so I haven't tested this much lately, but I'd like to see if I can find a new way to identify when an ad is playing! |
Does your app use the same api as iSponsorBlockTV? If so that app blocks the ads although, unlike yours the ip address for the chromecast does not seem to work. https://github.com/dmunozv04/iSponsorBlockTV/wiki/Installation |
The ads don't show up in the log or mute/skip, skipping segments works though. Casting to Chromecast with Google TV (or Android TV, it also needs a Youtube API key). Older 'standard' Chromecasts on same network work fine.
The text was updated successfully, but these errors were encountered: