05/23 Update new games data

This commit is contained in:
2026-05-23 17:14:23 -04:00
parent c792d9878e
commit edd2ed5660
5 changed files with 32 additions and 8 deletions
+2 -1
View File
@@ -18,7 +18,8 @@
"Bash(python -m pytest tests/test_backup.py -v)", "Bash(python -m pytest tests/test_backup.py -v)",
"Bash(python -m pytest --tb=short -q)", "Bash(python -m pytest --tb=short -q)",
"Bash(python -m pytest tests/test_wheeling.py -v)", "Bash(python -m pytest tests/test_wheeling.py -v)",
"WebFetch(domain:www.valottery.com)" "WebFetch(domain:www.valottery.com)",
"Bash(pip install *)"
] ]
} }
} }
+19 -3
View File
@@ -280,17 +280,33 @@ def _fetch_va_lottery(game_name: str, source: str, url: str) -> dict:
continue continue
try: try:
numbers = [int(n.strip()) for n in parts[1].split(",") if n.strip()] p1 = parts[1].strip()
p1_lower = p1.lower()
if p1_lower.startswith("day:"):
# Old twice-daily format: "Day: N1,...; Night: N1,..."
# Use Night draw only for consistency with modern single-draw records
if len(parts) >= 3 and "night:" in parts[2].lower():
night_str = parts[2][parts[2].lower().find("night:") + 6:]
numbers = [int(n.strip()) for n in night_str.split(",") if n.strip()]
else:
continue
elif p1_lower.startswith("night:"):
# Night-only historical record
numbers = [int(n.strip()) for n in p1[p1_lower.find("night:") + 6:].split(",") if n.strip()]
else:
numbers = [int(n.strip()) for n in p1.split(",") if n.strip()]
except ValueError as e: except ValueError as e:
logger.warning("[FETCH] VA %s parse error %r: %s", source, line, e) logger.warning("[FETCH] VA %s parse error %r: %s", source, line, e)
continue continue
bonus = None bonus = None
if len(parts) >= 3: if len(parts) >= 3:
colon = parts[2].rfind(":") p_last = parts[-1].strip()
if "night:" not in p_last.lower() and "day:" not in p_last.lower():
colon = p_last.rfind(":")
if colon >= 0: if colon >= 0:
try: try:
bonus = int(parts[2][colon + 1:].strip()) bonus = int(p_last[colon + 1:].strip())
except ValueError: except ValueError:
pass pass
Binary file not shown.
+6
View File
@@ -12,6 +12,12 @@ import threading
import tkinter as tk import tkinter as tk
from tkinter import ttk from tkinter import ttk
try:
import truststore
truststore.inject_into_ssl()
except Exception:
pass # not installed or not needed on this platform
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from db.database import init_db from db.database import init_db
+1
View File
@@ -4,3 +4,4 @@ numpy>=1.26.0
matplotlib>=3.8.0 matplotlib>=3.8.0
openpyxl>=3.1.0 openpyxl>=3.1.0
APScheduler>=3.10.0 APScheduler>=3.10.0
truststore>=0.9.0