ELO scraper: discover the embed link and retry transient failures
Read the current OneDrive link from the stat-check.com/elo iframe on each run, falling back to EMBED_URL if the page can't be read or its link 404s. Retry 429/5xx and network errors up to three times with backoff, after a one-off 503 from the Badger token endpoint failed a run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ The Stat Check page embeds a public OneDrive Excel workbook through a `1drv.ms`
|
||||
|
||||
The scraper reproduces the useful part of that flow:
|
||||
|
||||
0. Read the current `1drv.ms` embed link from the Stat Check page's iframe. Stat Check replaces this link occasionally, so it is looked up on every run; `EMBED_URL` in `pure_python_elo_scrape.py` is only a fallback for when the page can't be read or its link returns 404.
|
||||
1. Request an anonymous Microsoft "Badger" token from:
|
||||
`https://api-badgerp.svc.ms/v1.0/token`
|
||||
2. Convert the public OneDrive embed URL into Microsoft Graph's `shares/u!...` id format.
|
||||
@@ -24,6 +25,8 @@ The scraper reproduces the useful part of that flow:
|
||||
|
||||
The Microsoft endpoints used here are undocumented and could change, but this currently works without browser automation.
|
||||
|
||||
Requests that fail with HTTP 429, a 5xx status, or a network error are retried up to three times (after 5, 15 and 45 seconds).
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user