diff --git a/EPG/fetch.py b/EPG/fetch.py index fa79d9d..0335d9b 100644 --- a/EPG/fetch.py +++ b/EPG/fetch.py @@ -55,12 +55,13 @@ replace_ids = { } -async def fetch_xml(url: str) -> ET.Element: +async def fetch_xml(url: str) -> ET.Element | None: try: r = await client.get(url) r.raise_for_status() except Exception as e: - raise SystemExit(f'Failed to fetch "{url}"\n{e}') from e + print(f'Failed to fetch "{url}"\n{e}') + return try: decompressed_data = gzip.decompress(r.content) @@ -68,7 +69,7 @@ async def fetch_xml(url: str) -> ET.Element: return ET.fromstring(decompressed_data) except Exception as e: - raise SystemExit(f'Failed to decompress and parse XML from "{url}"\n{e}') from e + print(f'Failed to decompress and parse XML from "{url}"\n{e}') def hijack_id(