ytdl-org/youtube-dl · error · HTTPError

Unauthorized user "%s"

Error message

Unauthorized user "%s"

What it means

Thrown by SWFInterpreter.extract_class when the requested class name is not among the classes defined in the parsed ABC. The interpreter builds _classes_by_name from the SWF's class_info table; a KeyError on lookup becomes this ExtractorError. Practically it means the SWF you interpreted does not contain the class the extractor expects — usually a different/renamed player build.

Source

Thrown at devscripts/buildserver.py:331

class GITBuilder(GITInfoBuilder):
    def build(self):
        try:
            subprocess.check_output(['git', 'clone', 'git://github.com/%s/%s.git' % (self.user, self.repoName), self.buildPath])
            subprocess.check_output(['git', 'checkout', self.rev], cwd=self.buildPath)
        except subprocess.CalledProcessError as e:
            raise BuildError(e.output)

        super(GITBuilder, self).build()


class YoutubeDLBuilder(object):
    authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org']

    def __init__(self, **kwargs):
        if self.repoName != 'youtube-dl':
            raise BuildError('Invalid repository "%s"' % self.repoName)
        if self.user not in self.authorizedUsers:
            raise HTTPError('Unauthorized user "%s"' % self.user, 401)

        super(YoutubeDLBuilder, self).__init__(**kwargs)

    def build(self):
        try:
            proc = subprocess.Popen([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'], stdin=subprocess.PIPE, cwd=self.buildPath)
            proc.wait()
            #subprocess.check_output([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'],
            #                        cwd=self.buildPath)
        except subprocess.CalledProcessError as e:
            raise BuildError(e.output)

        super(YoutubeDLBuilder, self).build()


class DownloadBuilder(object):
    def __init__(self, **kwargs):
        self.handler = kwargs.pop('handler')

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Update youtube-dl / use yt-dlp so the extractor targets the current player.
  2. If you call swfinterp yourself, list available classes first: print(sorted(interpreter._classes_by_name)) and pick the correct (possibly renamed) class.
  3. For extractor maintainers, locate the new class name by disassembling the SWF (e.g. with a real ABC disassembler like ffdec) and update the name.
  4. Guard the call and fall back to a pure-Python reimplementation of the class's logic if interpretation is only used for one function.

Example fix

# before
avm_class = interpreter.extract_class('SignatureCipher')

# after
available = sorted(interpreter._classes_by_name)
if 'SignatureCipher' not in available:
    raise ExtractorError(
        'SignatureCipher missing; available: %s' % available[:10])
avm_class = interpreter.extract_class('SignatureCipher')
Defensive patterns

Strategy: validation

Validate before calling

# verify the class exists before extracting
available = getattr(interpreter, '_classes_by_name', {})
if class_name not in available:
    raise ExtractorError(
        'Class %r not in SWF (available: %s)' % (class_name, sorted(available)[:20]))

Type guard

def has_class(interp: 'SWFInterpreter', name: str) -> bool:
    return name in interp._classes_by_name

Try / catch

from youtube_dl.utils import ExtractorError
try:
    avm_class = interpreter.extract_class('Signature')
except ExtractorError as e:
    if 'not found' in str(e):
        avm_class = interpreter.extract_class('SignatureDecipher')  # renamed class
    else:
        raise

Prevention

When it happens

Trigger: Calling extract_class('SomeClass') on a SWF whose ABC defines no such class. In the wild: an extractor hard-codes a class name (e.g. a signature-descrambling class) and the site ships a renamed or reorganized player SWF.

Common situations: Player SWF obfuscation/renaming after a site update; downloading the wrong SWF (an ad or preloader SWF) because the extractor's URL pattern matched a different asset; stale hard-coded class names in an old youtube-dl release.

Understand the failure class

Related errors


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