{"record":{"id":"d339830c17e2d421","repo":"ytdl-org/youtube-dl","slug":"not-an-swf-file-header-is-r","errorCode":null,"errorMessage":"Not an SWF file; header is %r","messagePattern":"Not an SWF file; header is %r","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/swfinterp.py","lineNumber":18,"sourceCode":"from __future__ import unicode_literals\n\nimport collections\nimport io\nimport zlib\n\nfrom .compat import (\n    compat_str,\n    compat_struct_unpack,\n)\nfrom .utils import (\n    ExtractorError,\n)\n\n\ndef _extract_tags(file_contents):\n    if file_contents[1:3] != b'WS':\n        raise ExtractorError(\n            'Not an SWF file; header is %r' % file_contents[:3])\n    if file_contents[:1] == b'C':\n        content = zlib.decompress(file_contents[8:])\n    else:\n        raise NotImplementedError(\n            'Unsupported compression format %r' %\n            file_contents[:1])\n\n    # Determine number of bits in framesize rectangle\n    framesize_nbits = compat_struct_unpack('!B', content[:1])[0] >> 3\n    framesize_len = (5 + 4 * framesize_nbits + 7) // 8\n\n    pos = framesize_len + 2 + 2\n    while pos < len(content):\n        header16 = compat_struct_unpack('<H', content[pos:pos + 2])[0]\n        pos += 2\n        tag_code = header16 >> 6\n        tag_len = header16 & 0x3f","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/swfinterp.py#L1-L36","documentation":"Error \"Not an SWF file; header is %r\" thrown in ytdl-org/youtube-dl.","triggerScenarios":"Thrown at youtube_dl/swfinterp.py:18 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid SWF file; the header indicates the file is not SWF."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}