ytdl-org/youtube-dl · error · BuildError
Invalid repository "%s"
Error message
Invalid repository "%s"
What it means
Raised while parsing an ABC (ActionScript Byte Code) file inside a SWF: a class 'trait' entry has a kind byte outside the values swfinterp understands (0x00 slot/const variants are consumed earlier; 0x01-0x03 method/getter/setter, 0x04 class, 0x05 function). Any other kind — e.g. 0x06 const — aborts parsing with this ExtractorError. It means the SWF uses an ABC feature youtube-dl's interpreter never implemented.
Source
Thrown at devscripts/buildserver.py:329
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):View on GitHub (pinned to 956b8c5855)
Solutions
- Update youtube-dl or move to yt-dlp — the extractor likely no longer needs the SWF at all.
- As a patch, extend the kind dispatch in swfinterp.py: treat unknown kinds as opaque (consume slot_id via u30()) instead of raising, since traits you never call can be skipped.
- Use patch_function()/extract_class() only for the class you need after teaching the parser to skip unsupported traits.
- Reimplement the specific ActionScript logic (usually a signature scrambling function) in Python instead of interpreting the SWF.
Example fix
# before (swfinterp.py, parse_traits_info)
else:
raise ExtractorError('Unsupported trait kind %d' % kind)
# after: skip traits we do not need
else:
u30() # slot_id — ignore unsupported trait kinds
# then continue to the metadata handling below Defensive patterns
Strategy: fallback
Try / catch
from youtube_dl.utils import ExtractorError
try:
interpreter = SWFInterpreter(swf_bytes)
except ExtractorError as e:
if 'Unsupported trait kind' in str(e):
# SWF uses ABC traits this interpreter cannot parse;
# fall back to a native reimplementation of the needed function
return native_implementation()
raise Prevention
- Treat swfinterp as best-effort: always keep a non-SWF fallback path for signature computation.
- Patch unknown trait kinds to be skipped instead of fatal if you only need a few classes.
- Pin known-good player SWF versions in tests so a trait-kind regression is caught before release.
When it happens
Trigger: SWFInterpreter.parse_abc walks the instance_info/class_info trait tables; when it encounters a trait kind byte it does not have an elif branch for, it raises. Triggered by SWFs compiled with const traits or tooling that emits rare trait kinds (0x06 CONST, 0x0B-0x0F metadata-attributed variants can also fall through).
Common situations: A site rotates its player SWF and the new build contains a const trait on a class; youtube-dl then fails at parse time for that extractor's deciphering step. Extremely rare for direct API users; almost always hit via an extractor that interprets a remote SWF.
Related errors
- Missing mandatory parameter "%s"
- Is a directory: %s
- Invalid syntax in Cookie Header
- Invalid value %r in format specification %r
- Invalid filter specification %r
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/71b721d8ba2e5bc2.
Report an issue: GitHub.