erdnaxeli / castblock

Automatically skip sponsor segments and ads in YouTube videos playing on Chromecast.
MIT License
183 stars 20 forks source link

Segment at the begining of video can cause video to repeat #9

Closed stephen304 closed 3 years ago

stephen304 commented 3 years ago

I believe this might be an out of bounds issue where skipping past the end any amount causes it to seek to the beginning. An example is the latest wendover productions video (assuming you get the same or similar segments).

I'm not entirely sure whether I did anything for this because I remember thinking about it at one point...

erdnaxeli commented 3 years ago

I can reproduce it. If the chromecast send the video total duration this should be easy to fix, else…

erdnaxeli commented 3 years ago

Actually the bug was not exactly that. What happens is that this video also has a sponsor segment at the start of the video, and when the video ends (if there is no other next after), the chromecast send a message with the same media, current time being 0, and player_state being "PAUSED". Except that I was not checking the player state, so it just see that 0 is in the first segment and skip it.

Anyway, this is fixed.