ytdl-org/youtube-dl · error · NotImplementedError

Unsupported compression format %r

Error message

Unsupported compression format %r

What it means

Error "Unsupported compression format %r" thrown in ytdl-org/youtube-dl.

Source

Thrown at youtube_dl/swfinterp.py:23

import zlib

from .compat import (
    compat_str,
    compat_struct_unpack,
)
from .utils import (
    ExtractorError,
)


def _extract_tags(file_contents):
    if file_contents[1:3] != b'WS':
        raise ExtractorError(
            'Not an SWF file; header is %r' % file_contents[:3])
    if file_contents[:1] == b'C':
        content = zlib.decompress(file_contents[8:])
    else:
        raise NotImplementedError(
            'Unsupported compression format %r' %
            file_contents[:1])

    # Determine number of bits in framesize rectangle
    framesize_nbits = compat_struct_unpack('!B', content[:1])[0] >> 3
    framesize_len = (5 + 4 * framesize_nbits + 7) // 8

    pos = framesize_len + 2 + 2
    while pos < len(content):
        header16 = compat_struct_unpack('<H', content[pos:pos + 2])[0]
        pos += 2
        tag_code = header16 >> 6
        tag_len = header16 & 0x3f
        if tag_len == 0x3f:
            tag_len = compat_struct_unpack('<I', content[pos:pos + 4])[0]
            pos += 4
        assert pos + tag_len <= len(content), \
            ('Tag %d ends at %d+%d - that\'s longer than the file (%d)'

View on GitHub (pinned to 956b8c5855)

Solutions

  1. The SWF uses an unsupported compression; decompress it or update youtube-dl.

When it happens

Trigger: Thrown at youtube_dl/swfinterp.py:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/9d7e2d767fd06536. Report an issue: GitHub.