05/23 Update new games data
This commit is contained in:
@@ -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 *)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-7
@@ -280,19 +280,35 @@ 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 colon >= 0:
|
if "night:" not in p_last.lower() and "day:" not in p_last.lower():
|
||||||
try:
|
colon = p_last.rfind(":")
|
||||||
bonus = int(parts[2][colon + 1:].strip())
|
if colon >= 0:
|
||||||
except ValueError:
|
try:
|
||||||
pass
|
bonus = int(p_last[colon + 1:].strip())
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
result = insert_draw(game_id, draw_date, numbers, bonus=bonus, source=source)
|
result = insert_draw(game_id, draw_date, numbers, bonus=bonus, source=source)
|
||||||
if result == "inserted":
|
if result == "inserted":
|
||||||
|
|||||||
Binary file not shown.
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user