ytdl-org/youtube-dl · error · ValueError

Invalid value %r in format specification %r

Error message

Invalid value %r in format specification %r

What it means

Companion to the getproperty error: the 'callpropertyvoid' / void-property branch in swfinterp only handles _ScopeDict method calls and list 'reverse'; any other (method, object) pair raises NotImplementedError('Unsupported (void) property %r on %r'). It fires when interpreted ActionScript invokes a mutating/side-effecting method whose result is discarded, and that method is not modeled.

Source

Thrown at youtube_dl/YoutubeDL.py:1251

            '=': operator.eq,
            '!=': operator.ne,
        }
        operator_rex = re.compile(r'''(?x)\s*
            (?P<key>width|height|tbr|abr|vbr|asr|filesize|filesize_approx|fps)
            \s*(?P<op>%s)(?P<none_inclusive>\s*\?)?\s*
            (?P<value>[0-9.]+(?:[kKmMgGtTpPeEzZyY]i?[Bb]?)?)
            $
            ''' % '|'.join(map(re.escape, OPERATORS.keys())))
        m = operator_rex.search(filter_spec)
        if m:
            try:
                comparison_value = int(m.group('value'))
            except ValueError:
                comparison_value = parse_filesize(m.group('value'))
                if comparison_value is None:
                    comparison_value = parse_filesize(m.group('value') + 'B')
                if comparison_value is None:
                    raise ValueError(
                        'Invalid value %r in format specification %r' % (
                            m.group('value'), filter_spec))
            op = OPERATORS[m.group('op')]

        if not m:
            STR_OPERATORS = {
                '=': operator.eq,
                '^=': lambda attr, value: attr.startswith(value),
                '$=': lambda attr, value: attr.endswith(value),
                '*=': lambda attr, value: value in attr,
            }
            str_operator_rex = re.compile(r'''(?x)
                \s*(?P<key>ext|acodec|vcodec|container|protocol|format_id|language)
                \s*(?P<negation>!\s*)?(?P<op>%s)(?P<none_inclusive>\s*\?)?
                \s*(?P<value>[a-zA-Z0-9._-]+)
                \s*$
                ''' % '|'.join(map(re.escape, STR_OPERATORS.keys())))
            m = str_operator_rex.search(filter_spec)

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Add an elif for the named method in the void-property branch of swfinterp.py (the error text tells you mname and the container type; e.g. push → obj.append(args[0])).
  2. patch_function the enclosing ActionScript method with a Python equivalent so the void call never runs.
  3. Update youtube-dl / move to yt-dlp where the routine is usually reimplemented natively.

Example fix

# before (swfinterp.py, void-property branch)
if mname == 'reverse':
    assert isinstance(obj, list)
    obj.reverse()
else:
    raise NotImplementedError(...)

# after
if mname == 'reverse':
    assert isinstance(obj, list)
    obj.reverse()
elif mname == 'push' and isinstance(obj, list):
    for a in args:
        obj.append(a)
else:
    raise NotImplementedError(...)
Defensive patterns

Strategy: fallback

Try / catch

try:
    out = func(args)
except NotImplementedError as e:
    if 'Unsupported (void) property' in str(e):
        interpreter.patch_function(avm_class, caller_name,
                                   lambda a: py_equivalent(a))
        out = func(args)
    else:
        raise

Prevention

When it happens

Trigger: Bytecode executes a call whose return value is unused (callpropertyvoid) on an object the interpreter does not special-case — e.g. array.push(x), object property initialization, or a Vector append. Only reverse on plain Python lists is handled before the raise.

Common situations: Signature-scrambling players that build arrays with push()/splice() before reversing; any player update that adds a void call to the decipher routine; custom swfinterp experiments.

Related errors


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