From f56c4bc3c9931e7dfee7228038b02c4e063002f3 Mon Sep 17 00:00:00 2001 From: Marcus Klein Date: Tue, 29 Sep 2026 20:32:45 +0200 Subject: [PATCH] Detect a SMIL 403 by the ref it is reported in, not anywhere in the document The access-forbidden check tested "403" against the whole SMIL response. Every SMIL carries a trackingData attribute full of numeric ids, so the test matches their digits: cid=2684244037393 contains 403 and made the parser reject a perfectly good document. nPVR recordings were unplayable this way, each answering HTTP 404 on playback while the very same response still yielded a valid releasePid and complete tracking data -- which a real error document would not carry. The neighbouring branches already read the title, which is where theplatform reports the failure, so match there instead: a 403 as its own token in title or abstract, or the word "forbidden" in either. --- lib/streaming_providers/providers/magenta2/smil_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/streaming_providers/providers/magenta2/smil_manager.py b/lib/streaming_providers/providers/magenta2/smil_manager.py index bb353ad..f76cbb0 100644 --- a/lib/streaming_providers/providers/magenta2/smil_manager.py +++ b/lib/streaming_providers/providers/magenta2/smil_manager.py @@ -604,7 +604,8 @@ class SmilManager: if "Invalid Token" in title or "InvalidAuthToken" in smil_content: logger.error(f"SMIL invalid token for {content_id}: {title}") return None - if "403" in smil_content: + if re.search(r"\b403\b", title) or re.search(r"\b403\b", abstract) \ + or "forbidden" in f"{title} {abstract}".lower(): logger.error( f"SMIL access forbidden (403) for {content_id}: {title}" )