{"record":{"id":"5abbf99ad5441310","repo":"ytdl-org/youtube-dl","slug":"missing-mandatory-parameter-s","errorCode":null,"errorMessage":"Missing mandatory parameter \"%s\"","messagePattern":"Missing mandatory parameter \"(.+?)\"","errorType":"http","errorClass":"BuildError","httpStatus":500,"severity":"error","filePath":"devscripts/buildserver.py","lineNumber":302,"sourceCode":"                pass\n\n        if not python_path:\n            raise BuildError('No such Python version: %s' % python_version)\n\n        self.pythonPath = python_path\n\n        super(PythonBuilder, self).__init__(**kwargs)\n\n\nclass GITInfoBuilder(object):\n    def __init__(self, **kwargs):\n        try:\n            self.user, self.repoName = kwargs['path'][:2]\n            self.rev = kwargs.pop('rev')\n        except ValueError:\n            raise BuildError('Invalid path')\n        except KeyError as e:\n            raise BuildError('Missing mandatory parameter \"%s\"' % e.args[0])\n\n        path = os.path.join(os.environ['APPDATA'], 'Build archive', self.repoName, self.user)\n        if not os.path.exists(path):\n            os.makedirs(path)\n        self.basePath = tempfile.mkdtemp(dir=path)\n        self.buildPath = os.path.join(self.basePath, 'build')\n\n        super(GITInfoBuilder, self).__init__(**kwargs)\n\n\nclass GITBuilder(GITInfoBuilder):\n    def build(self):\n        try:\n            subprocess.check_output(['git', 'clone', 'git://github.com/%s/%s.git' % (self.user, self.repoName), self.buildPath])\n            subprocess.check_output(['git', 'checkout', self.rev], cwd=self.buildPath)\n        except subprocess.CalledProcessError as e:\n            raise BuildError(e.output)\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/devscripts/buildserver.py#L284-L320","documentation":"Raised by swfinterp._extract_tags when the SWF file's compression signature (first byte) is not 'C' (CWS, zlib-compressed). youtube-dl's interpreter only implements zlib-compressed SWFs; uncompressed 'FWS' and LZMA-compressed 'ZWS' files hit this NotImplementedError. It indicates the interpreter received a valid SWF whose compression variant it cannot decode.","triggerScenarios":"Passing an uncompressed SWF (starts with b'FWS') or an LZMA-compressed SWF (starts with b'ZWS', Flash 13+) to SWFInterpreter / _extract_tags. Common when a site ships an uncompressed player SWF or a newer LZMA-compressed one and youtube-dl downloads it for signature deciphering.","commonSituations":"Site updates its player to a newer Flash toolchain producing ZWS files; developer feeds a locally-saved uncompressed SWF; partial download that corrupts the header also misroutes here.","solutions":["Pre-compress the payload before handing it to the interpreter: read the real header, then zlib.compress the body and rewrite the signature to 'CWS' (only viable if you control the input).","For FWS files, you can wrap them: decompress nothing, but easiest is to recompress the whole file and patch bytes 0-2 to b'CWS' plus the original uncompressed length.","Update to yt-dlp, which dropped SWF interpretation in favor of ported JS deciphering for the sites that still need it.","If you maintain an extractor, prefer reimplementing the player's signing algorithm in Python instead of interpreting the SWF."],"exampleFix":"# before\ninterp = SWFInterpreter(swf_bytes)  # raises for b'FWS'/b'ZWS'\n\n# after: normalize an uncompressed FWS to CWS so swfinterp accepts it\nimport struct, zlib\nif swf_bytes[:1] == b'F':\n    body = swf_bytes[8:]\n    compressed = zlib.compress(body)\n    header = b'CWS' + swf_bytes[3:8] + compressed\n    swf_bytes = header\ninterp = SWFInterpreter(swf_bytes)","handlingStrategy":"fallback","validationCode":"import zlib\n\ndef normalize_to_cws(data):\n    \"\"\"Return a CWS (zlib) payload swfinterp accepts, or None if impossible.\"\"\"\n    if data[:3] == b'CWS':\n        return data\n    if data[:3] == b'FWS':\n        return b'CWS' + data[3:8] + zlib.compress(data[8:])\n    return None  # ZWS (LZMA) unsupported by this swfinterp","typeGuard":"def swf_is_zlib_compressed(data: bytes) -> bool:\n    return data[:3] == b'CWS'","tryCatchPattern":"try:\n    tags = _extract_tags(swf_bytes)\nexcept NotImplementedError as e:  # 'Unsupported compression format'\n    normalized = normalize_to_cws(swf_bytes)\n    if normalized is None:\n        raise ExtractorError('LZMA SWF not supported; decompress externally')\n    tags = _extract_tags(normalized)","preventionTips":["Recompress FWS payloads to CWS before interpretation.","Pre-decompress ZWS payloads with lzma yourself and rewrite the header to FWS/CWS.","Prefer reimplementing the player's logic in Python over relying on SWF interpretation."],"tags":["swf","flash","compression","not-implemented"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}