GMPranav / SRCDVD

A tool to detect runs with unviewable (deleted/private/expired) YouTube and Twitch for a given game in speedrun.com
Creative Commons Zero v1.0 Universal
6 stars 0 forks source link

Option to filter out 'obsolete' runs #6

Open HexTree opened 1 year ago

HexTree commented 1 year ago

The tool currently includes runs that are marked on SRC as 'obsolete' or 'orphaned'. Example of obsolete: https://www.speedrun.com/azure_dreams/runs/mrk80gdy Example of orphaned: https://www.speedrun.com/azure_dreams/runs/zxkkvr8m

These are runs that don't appear on the main leaderboard, usually because the same user has beaten them with a new run. It would be nice to be able to ignore these, because we generally don't care whether those historical runs have working VODs.

partoftheworlD commented 1 year ago

Thanks for your report.

I'll leave a note here for the future. Since Elo do all sorts of weird things with their api, to check for oboslete we will need to additionally request for run page properties via "https://www.speedrun.com/_next/data/90CX0aP4QsyNiynjyn36V/en-US/{{{game_abbr}}}/runs/{{run_id}}.json", but I'm confused by the value "90CX0aP4QsyNiynjyn36V", we'll have to find out how NextJS generates this value to use generation in utility code without having to hard code the value every update from speedrun.com side. I think this part of the code should be rewritten.

https://github.com/GMPranav/SRCDVD/blob/7e2bbf9a4bcaf958c7160955ee388a4e868611c4/Data.py#L48-L59

I'll take a closer look as soon as I have some free time.

GMPranav commented 1 week ago

Super late response, but I think the v1 API, which is what is exposed for public consumption, does not have a parameter in the runs API to tell whether a given run is obsolete or orphaned. The only way to figure it out would be to call the leaderboard API for the category that the run belongs to and check whether the run exists in that list or not.

However, I also think including obsolete runs is a good idea. From my experience it's usually a cascade of runs from the runner whose VODs are expired/privated/deleted/etc. If your reject their latest PB, then most likely the older run also has it's VOD gone. And that one becomes the new non-obsolete run in the leaderboard.