Skip to content

Conversation

@boltgolt
Copy link
Contributor

When a video is done YouTube sometimes plays +/- 30 seconds of ads after the video. This PR forcefully stops the video when its play time is over, returning to the app home screen and skipping the ads.

@dmunozv04
Copy link
Owner

This looks really cool, thanks for the PR. I'll take a look soon

@dmunozv04
Copy link
Owner

If anyone wants to test this, I've pushed an image: ghcr.io/dmunozv04/isponsorblocktv:pr-244 or dmunozv04/isponsorblocktv:pr-244

@boltgolt boltgolt changed the title Add setting tp skip post-video ads by force Setting to skip post-video ads by force Feb 14, 2025
Copy link
Owner

@dmunozv04 dmunozv04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked, but we should make sure that a video ending in a sponsor segment would properly trigger the stop and not attempt to skip the sponsor segment, to be left with the post-video ads

# Trigger a few frames earlier to avoid the video end event canceling the task
await asyncio.sleep(time_to - 0.1)
self.logger.info("Force stopping video, end of expected play time reached")
await asyncio.create_task(self.lounge_controller._command("stopVideo"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better if a new method was created on the YTLounge class

@boltgolt
Copy link
Contributor Author

Good point, because of how scheduling works i don't believe that would trigger the force stop

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

Successfully merging this pull request may close these issues.

2 participants