tanersb / TwitchRecover

66 stars 30 forks source link

Fundamental flaw with twitch timestamps. #17

Open ne0lith opened 6 months ago

ne0lith commented 6 months ago

A lot of times it will say a vod isn't found, but it's because you also need to brute force the minutes. Obviously with the seconds this is known. But a lot of unrecoverable vods, just have the minute off by 1-2. Noticed it seems to be more likely to happen if the minute timestamp ends in a zero. This is probably some rounding error on twitch or the trackersites. I'd suggest brute forcing the minutes (only down and up by 1) in the event an m3u8 url isn't found. This is how I've done it on my own implementation. Also, this may be obvious, but if the minute is off due to a rounding error, then the seconds also necessarily need to be brute forced. I'd only suggest looking back and forward by 1 minute. Otherwise you end up with a million requests.

tanersb commented 6 months ago

Can you send a pull request if you made an edit?

ne0lith commented 6 months ago

I have a hastey rewrite of this project atm, so can't really do a PR until it's cleaned up. Trying to implement flaresolverr'd as well (for streamscharts). But here's a proof of concept for how I handle minutes. Little flaw is I haven't done the offset for the edge case of the minutes being 00, because then you'd have to also offset the hour by -1. Also, excuse my english please.

https://gist.github.com/ne0lith/eb5b3b76ae201a6f08ad6a0df2ea34fe