{"record":{"id":"45f3bddf25c9d9b6","repo":"calesthio/OpenMontage","slug":"invalid-base64-in-label-data-uri","errorCode":null,"errorMessage":"invalid base64 in {label} Data URI","messagePattern":"invalid base64 in (.+?) Data URI","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":1118,"sourceCode":"        label: str,\n    ) -> tuple[str, bytes]:\n        match = re.fullmatch(\n            r\"data:([a-z]+/[a-z0-9.+-]+);base64,([A-Za-z0-9+/=]+)\",\n            value,\n            flags=re.IGNORECASE,\n        )\n        if not match:\n            raise ValueError(\n                f\"{label} Data URI must use a supported MIME type and \"\n                \"strict base64 encoding\"\n            )\n        mime = match.group(1).lower()\n        if mime not in set(suffix_to_mime.values()):\n            raise ValueError(f\"unsupported {label} Data URI MIME type: {mime}\")\n        try:\n            decoded = base64.b64decode(match.group(2), validate=True)\n        except (ValueError, binascii.Error) as exc:\n            raise ValueError(f\"invalid base64 in {label} Data URI\") from exc\n        if len(decoded) >= max_bytes:\n            raise ValueError(\n                f\"decoded {label} Data URI must be smaller than \"\n                f\"{max_bytes // (1024 * 1024)} MB\"\n            )\n        return mime, decoded\n\n    def _local_or_data_audio_duration(\n        self, value: str, *, max_seconds: int = 15\n    ) -> float | None:\n        if value.startswith(\"data:\"):\n            mime, decoded = self._decode_data_uri(\n                value,\n                suffix_to_mime=self.AUDIO_SUFFIX_TO_MIME,\n                max_bytes=self.MAX_AUDIO_BYTES,\n                label=\"audio\",\n            )\n            return self._probe_audio_bytes(decoded, mime, max_seconds=max_seconds)","sourceCodeStart":1100,"sourceCodeEnd":1136,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L1100-L1136","documentation":"Error \"invalid base64 in {label} Data URI\" thrown in calesthio/OpenMontage.","triggerScenarios":"The base64 payload of a reference Data URI fails strict decoding.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the payload with standard base64 (padding included, no newlines).","If building the URI manually, use base64.b64encode(data).decode() rather than urlsafe variants."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}