{"record":{"id":"1d898a5b4b122b2f","repo":"ytdl-org/youtube-dl","slug":"unauthorized-user-s","errorCode":null,"errorMessage":"Unauthorized user \"%s\"","messagePattern":"Unauthorized user \"(.+?)\"","errorType":"http","errorClass":"HTTPError","httpStatus":401,"severity":"error","filePath":"devscripts/buildserver.py","lineNumber":331,"sourceCode":"class 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\n        super(GITBuilder, self).build()\n\n\nclass YoutubeDLBuilder(object):\n    authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org']\n\n    def __init__(self, **kwargs):\n        if self.repoName != 'youtube-dl':\n            raise BuildError('Invalid repository \"%s\"' % self.repoName)\n        if self.user not in self.authorizedUsers:\n            raise HTTPError('Unauthorized user \"%s\"' % self.user, 401)\n\n        super(YoutubeDLBuilder, self).__init__(**kwargs)\n\n    def build(self):\n        try:\n            proc = subprocess.Popen([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'], stdin=subprocess.PIPE, cwd=self.buildPath)\n            proc.wait()\n            #subprocess.check_output([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'],\n            #                        cwd=self.buildPath)\n        except subprocess.CalledProcessError as e:\n            raise BuildError(e.output)\n\n        super(YoutubeDLBuilder, self).build()\n\n\nclass DownloadBuilder(object):\n    def __init__(self, **kwargs):\n        self.handler = kwargs.pop('handler')","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/devscripts/buildserver.py#L313-L349","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Update youtube-dl / use yt-dlp so the extractor targets the current player.","If you call swfinterp yourself, list available classes first: print(sorted(interpreter._classes_by_name)) and pick the correct (possibly renamed) class.","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.","Guard the call and fall back to a pure-Python reimplementation of the class's logic if interpretation is only used for one function."],"exampleFix":"# before\navm_class = interpreter.extract_class('SignatureCipher')\n\n# after\navailable = sorted(interpreter._classes_by_name)\nif 'SignatureCipher' not in available:\n    raise ExtractorError(\n        'SignatureCipher missing; available: %s' % available[:10])\navm_class = interpreter.extract_class('SignatureCipher')","handlingStrategy":"validation","validationCode":"# verify the class exists before extracting\navailable = getattr(interpreter, '_classes_by_name', {})\nif class_name not in available:\n    raise ExtractorError(\n        'Class %r not in SWF (available: %s)' % (class_name, sorted(available)[:20]))","typeGuard":"def has_class(interp: 'SWFInterpreter', name: str) -> bool:\n    return name in interp._classes_by_name","tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    avm_class = interpreter.extract_class('Signature')\nexcept ExtractorError as e:\n    if 'not found' in str(e):\n        avm_class = interpreter.extract_class('SignatureDecipher')  # renamed class\n    else:\n        raise","preventionTips":["Inspect interpreter._classes_by_name to confirm the class name before extraction.","Extract class names from the live player SWF rather than hard-coding them.","Wrap extract_class and try known renames before giving up."],"tags":["swf","extractor","class-lookup"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}