from __future__ import annotations import re from typing import Any from urllib.parse import urljoin from app.config import DWD_RADAR_BASE_URL, RADAR_PRODUCT from app.http_client import fetch_text RADAR_FILE_RE = re.compile(r"^[A-Za-z0-9_.-]+\.(?:tar|tar\.bz2|bz2|gz)$", re.IGNORECASE) def parse_apache_index(html: str, suffixes: tuple[str, ...] | None = None) -> list[dict[str, Any]]: files: list[dict[str, Any]] = [] pattern = re.compile( r'href="(?P[^"]+)"[^>]*>[^<]+\s*' r'(?P\d{2}-[A-Za-z]{3}-\d{4})\s+(?P