dmunozv04 / iSponsorBlockTV

SponsorBlock client for all YouTube TV clients.
GNU General Public License v3.0
2.17k stars 89 forks source link

Shorts aren't handled anymore #162

Closed Soheab closed 1 month ago

Soheab commented 1 month ago

Describe the bug

I believe the following code made it so it played shorts as a regular video, but it doesn't seem to work anymore as a of today: https://github.com/dmunozv04/iSponsorBlockTV/blob/5214190fd0cc8603759546a30e7d692d119e4c79/src/iSponsorBlockTV/ytlounge.py#L139-L148

It just logs iSponsorBlockTV-XXX Subscribe completed, status 200 OK and then never works again until restarted. I had added some debug prints to print the event type, which it does print:

Event type:  loungeScreenDisconnected [{'reason': 'disconnectedByUserScreenInitiated'}]

but the event that is supposed to "handle it" (onSubtitlesTrackChanged) is not.

iSponsorBlockTV server

Apple TV

dmunozv04 commented 1 month ago

Maybe it's some sort of regression that happened when updating to the newest pyytlounge

Soheab commented 1 month ago

Maybe it's some sort of regression that happened when updating to the newest pyytlounge

yup that seems to be it! pyytlounge version 1.7.0 continues with all the handling.

dmunozv04 commented 1 month ago

If you find the reason and manage to solve it, please do make a PR. I'll try to look into it when I have time. Thanks for reporting!!

Soheab commented 1 month ago

v2.0.0 seems to have changed a lot around ClientSession but i'm unfortunately not experienced enough with this API to know what exactly.

Full list of changes for anyone: https://github.com/FabioGNR/pyytlounge/compare/v1.7.0...v2.0.0?diff=unified&w=

Soheab commented 1 month ago

Found something kinda.. the following commit resets the lounge token whenever a disconnect is detected in v2: https://github.com/FabioGNR/pyytlounge/commit/db60f9605f62ca7000c3f28026033828e7981d36

Overriding that method in the YtLoungeApi subclass at src/iSponsorBlockTV/ytlounge.py and preventing it from resetting it seems to fix the shorts issue:

def _lounge_token_expired(self):
    pass

But I don't know if that causes any other issues, I don't see any personally.

dmunozv04 commented 1 month ago

Thanks for finding the culprit. I suspect it won’t break anything since I there’s another task that will renew the token every 24 hours iirc, supposedly preventing it from getting stale

dmunozv04 commented 1 month ago

Fixed on V2.0.8. Thanks for your help @Soheab !