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 <ref> 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.
This commit is contained in:
Marcus Klein
2026-09-30 15:39:50 +02:00
committed by Marcus Klein
parent 15b8c22d9f
commit f56c4bc3c9
@@ -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}"
)