gabe565 / CastSponsorSkip

⏭️ Skip YouTube ads and sponsorships on all local Google Cast devices
Apache License 2.0
286 stars 6 forks source link

Video Detection not occurring until 30s-45s into videos usually #11

Closed QueenLinuxGlitch closed 11 months ago

QueenLinuxGlitch commented 11 months ago

Using new version, on advise to not change pause interval Both the device running the program (Windows 11 Laptop) and the YouTube-playing chromecast Ultra w/ Google TV (Using standard youtube app) are on ethernet. Still most of the time, the detection of the playback of a video doesn't occur until 30s-45s in, sometimes missing content at the beginning of the video

gabe565 commented 11 months ago

Oh I see what you mean now. Hmm video play detection works almost instantly for me. I have two thoughts:

  1. It's possible that not all devices send an event when the video starts, but that seems to be part of the Cast spec. What device are you casting to? Scratch that. I missed that you said you had a Chromecast Ultra. Thanks for that :)
  2. It's also possible that something doesn't get correctly set up on Windows, so the events don't work. I'll do some testing in Windows ASAP!
gabe565 commented 11 months ago

For reference, here's how quickly streams get found in my case. I've only tested with macOS and Linux so far so that may be the difference here.

https://github.com/gabe565/CastSponsorSkip/assets/7717888/1ad520d1-361d-447a-9b1a-3fbab3cd64bf

QueenLinuxGlitch commented 11 months ago

So in my case, here's my full breakdown. a Chromecast Ultra w/ Google TV running Android 12, and I am not actually casting, I am playing the videos through the app loaded onto my chromecast, so that may be a difference there. As mentioned before, the two relevant devices are ethernet-ed in. Hoping that helps give context

gabe565 commented 11 months ago

Thanks! Hmm so I only ever cast. I'll see if it behaves similarly for me if I start a video directly on the device!

gabe565 commented 11 months ago

12 made me realize videos weren't being considered as playing when they were buffering. Ads also set the status to buffering, so that may have been the problem here. Can you update to v0.3.0 and test again? Thank you!

QueenLinuxGlitch commented 11 months ago

Just updated, will report results later, that is so interesting, but makes a lot of sense, as I was usually pulling long videos that would not buffer immediately

QueenLinuxGlitch commented 11 months ago

Probably unrelated, but what does it mean when "Failed to find video on Youtube", "Search returned no videos", was just on a video with sponsor and that was in the log immediately.

In another instance, i got the above error, but then it immediately resolved correctly

2023/08/28 22:16:43 INFO Video ID not found. Searching for video on YouTube... device="Living Room TV" 2023/08/28 22:16:44 ERROR Failed to find video on YouTube. device="Living Room TV" error="search returned no videos" 2023/08/28 22:16:46 INFO Video ID not found. Searching for video on YouTube... device="Living Room TV" 2023/08/28 22:16:46 INFO Detected video stream. device="Living Room TV" video_id=Fio7yA44Amc 2023/08/28 22:16:46 INFO No segments found for video. device="Living Room TV" video_id=Fio7yA44Amc

QueenLinuxGlitch commented 11 months ago

Otherwise, detection is working immediately, so problem solved lol, but question above.

gabe565 commented 11 months ago

Interesting! Lol It's good to know the delays are fixed at least.

I'll do some more testing. I suspect that might have happened because it started looking for the video ID before the actual video was playing. Maybe due to buffering or an ad, but it tried to find the video ID with the YouTube API a couple of times before it was able to find the video data. I'll see what I can figure out, but hey at least it's working!

QueenLinuxGlitch commented 11 months ago

Indeed!

QueenLinuxGlitch commented 10 months ago

As of yesterday, no detections are occurring. Restarted the CLI multiple times, connects to both my cast devices immediately, but no youtube streams are being read anymore, I'll test more later, something must be up but I can't tell what.

EDIT: After using v4.0, still no change, although I really like the changes, assuming I can get them functional again.

EDIT 2: Neither through casting or launching through the youtube app are being detected from either of my casting devices.

EDIT 3: After a while, videos were being detected when I would cast from my phone, but not through normal play through app.

EDIT 4: All good, had to cast videos manually to both devices and restart them before they started registering, one of my Cast devices started not reacting to any casts

EDIT 5: Finally got it to work, only for youtube to say i've exceeded my quota. did not expect that one