auto-sync: 2026-04-20 15:50:01
This commit is contained in:
@@ -22,7 +22,7 @@ class Config:
|
||||
"SVO": {"iata": "SVO", "icao": "UUEE", "yandex_code": "s9600213", "name": "Шереметьево"},
|
||||
"DME": {"iata": "DME", "icao": "UUDD", "yandex_code": "s9600366", "name": "Домодедово"},
|
||||
"VKO": {"iata": "VKO", "icao": "UUWW", "yandex_code": "s9600215", "name": "Внуково"},
|
||||
"ZIA": {"iata": "ZIA", "icao": "UUBW", "yandex_code": "s9881291", "name": "Жуковский"},
|
||||
"ZIA": {"iata": "ZIA", "icao": "UUBW", "yandex_code": "s9850865", "name": "Жуковский"},
|
||||
})
|
||||
|
||||
# Rate limits (seconds between requests)
|
||||
|
||||
@@ -93,6 +93,14 @@ def _parse_item(item: Dict, direction: str) -> Optional[Dict]:
|
||||
|
||||
carrier = thread.get("carrier", {})
|
||||
|
||||
# Normalize flight number: Yandex returns "SU 1234 12345" (number + extra codes)
|
||||
# Keep only first two tokens: airline code + flight number → "SU 1234"
|
||||
parts = flight_number.split()
|
||||
if len(parts) >= 2:
|
||||
flight_number = f"{parts[0]} {parts[1]}"
|
||||
else:
|
||||
flight_number = parts[0] if parts else flight_number
|
||||
|
||||
# Scheduled time: departure event → use 'departure' field; arrival → 'arrival'
|
||||
scheduled_at = item.get("departure") if direction == "departure" else item.get("arrival")
|
||||
if not scheduled_at:
|
||||
|
||||
Reference in New Issue
Block a user