feat: add high-pace leagues KBL, LNB-DR, BSN, WNBA (2025/2026) - #11
Merged
Conversation
Register four new leagues for scraping + Sofascore enrichment: - KBL (South Korea, men) FS /basketball/south-korea/kbl/ sofa 1540 / s78467 - LNB_DR (Dominican Republic) FS /basketball/dominican-republic/lnb/ sofa 14089 / s92524 - BSN (Puerto Rico) FS /basketball/puerto-rico/bsn/ sofa 17374 / s91302 - WNBA (USA, women) FS /basketball/usa/wnba/ sofa 486 / s89004 collector_config.py + catalog.py entries follow the existing TypedDict pattern (season 2025/2026, REGULAR). The Dominican league is keyed LNB_DR to avoid shadowing France's LNB (tournament 156). No Go changes needed: mapper.go already returns an error (never panics) on a missing "ALL" period or incomplete box score, and enrich.go treats that as a soft skip — regional leagues without Sofascore box score keep their Flashscore quarter breakdown. Date parsing already handles KBL's 2025→2026 boundary via full-date parsing + a 540-day look-back. Tests: KBL year-crossing regression in test_collector_parse; new test_league_configs locks registry invariants (key/tournament_name match, no duplicate Sofascore ids, LNB≠LNB_DR). 192 pytest green, go test green, mypy/ruff clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Flashscore's 2026 DOM refresh renamed the results-row date element, so the collector scraped an empty time string and skipped EVERY match (match_dt=None) across ALL leagues, not just the new ones. Select .event__stageTime with a .event__time fallback. Verified: KBL/LNB_DR/BSN/WNBA collected 758 matches (0 skips) with full Q1-Q4 breakdown; KBL's 2025->2026 season boundary parses correctly (2025-10-03 .. 2026-05-13). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
Добавлены 4 высокотемповые лиги (сезон 2025/2026) в пайплайн сбора + Sofascore-каталог, попутно починена глобальная регрессия скрейпера, собраны данные и проведена честная валидация V6.
1. Новые лиги (
collector_config.py+catalog.py)KBL/basketball/south-korea/kbl/LNB_DR/basketball/dominican-republic/lnb/BSN/basketball/puerto-rico/bsn/WNBA/basketball/usa/wnba/TypedDict-паттерн, сезон 25/26 REGULAR. Доминикана — ключ
LNB_DR(не затеняет ФранциюLNB/156). Sofascore-ID добыты через Playwright и подтверждены заказчиком (BSN/WNBA).2. 🐛 Фикс глобальной регрессии Flashscore
При боевом сборе вскрылось: Flashscore в DOM-рефреше 2026 переименовал узел даты
.event__time→.event__stageTime. Коллектор доставал пустую дату →match_dt=None→ скипал КАЖДЫЙ матч во ВСЕХ лигах (не только новых). Фикс — селектор.event__stageTimeс фолбэком на старый класс. Одна строка, чинит весь скрейпер.3. Собранные данные (в БД, не в git)
758 матчей, все с Q1–Q4, 100% покрытие реальными линиями (odds-бэкфилл):
KBL-переход года 2025→2026 подтверждён на боевых данных (регресс-тест стережёт).
4. Валидация V6 (Full Time тоталы, honest 80/20 chrono, CI95, порог 0.54)
Вывод: статзначимого эджа нет ни на одной лиге. Все CI95 накрывают ноль; WNBA/KBL AUC ниже монетки. Дисперсия летнего баскетбола + малый объём (20–55 ставок) не поддаются V6 — та же «стена V6». Чистый отрицательный результат.
Отложено (Вариант C) — поквартальный box-score
Реверс-инжиниринг Sofascore: per-quarter (
1Q–4Q) box-score физически есть только у WNBA (fill_rate 100%), у KBL/LNB/BSN — 0% (ALLonly). Плюс рынка 1H/1Q O/U у букмекеров не существует. Кросс-стек рефактор четвертей осознанно отложен; box-score остаётся match-level.Код-ревью по кодексу — пройдено
SOLID/DRY/KISS ✓ · все файлы ≤250 строк (max 241) · строгая типизация (TypedDict) ✓ · без
print()✓ · без магических чисел (внешние ID задокументированы) ✓ · zero hardcode (лиги/слаги/ID в конфигах) ✓ · data models — TypedDict ✓.Гейт: 192 pytest · go vet + go test OK · mypy 0 (111 файлов) · ruff чисто.
Изменённые файлы (5)
collector_config.py,catalog.py— +4 лиги.collector_page.py— фикс селектора даты.tests/test_collector_parse.py— KBL year-crossing.tests/test_league_configs.py— инварианты реестров (новый).🤖 Generated with Claude Code