ytdl-org/youtube-dl · error · ExtractorError
Unable to login: %s said: %s
Error message
Unable to login: %s said: %s
What it means
Raised by the AfreecaTV extractor when the login API returns a RESULT code other than 1. The message embeds a human-readable explanation from a code table (wrong password, blocked account, global-vs-Korean account conflict, etc.), falling back to 'You have failed to log in.' for unknown codes. Marked expected=True.
Source
Thrown at youtube_dl/extractor/afreecatv.py:219
-4: 'Your account has been suspended due to a violation of our terms and policies.',
-5: 'https://member.afreecatv.com/app/user_delete_progress.php',
-6: 'https://login.afreecatv.com/membership/changeMember.php',
-8: "Hello! AfreecaTV here.\nThe username you have entered belongs to \n an account that requires a legal guardian's consent. \nIf you wish to use our services without restriction, \nplease make sure to go through the necessary verification process.",
-9: 'https://member.afreecatv.com/app/pop_login_block.php',
-11: 'https://login.afreecatv.com/afreeca/second_login.php',
-12: 'https://member.afreecatv.com/app/user_security.php',
0: 'The username does not exist or you have entered the wrong password.',
-1: 'The username does not exist or you have entered the wrong password.',
-3: 'You have entered your username/password incorrectly.',
-7: 'You cannot use your Global AfreecaTV account to access Korean AfreecaTV.',
-10: 'Sorry for the inconvenience. \nYour account has been blocked due to an unauthorized access. \nPlease contact our Help Center for assistance.',
-32008: 'You have failed to log in. Please contact our Help Center.',
}
result = int_or_none(response.get('RESULT'))
if result != 1:
error = _ERRORS.get(result, 'You have failed to log in.')
raise ExtractorError(
'Unable to login: %s said: %s' % (self.IE_NAME, error),
expected=True)
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
if re.search(r'alert\(["\']This video has been deleted', webpage):
raise ExtractorError(
'Video %s has been deleted' % video_id, expected=True)
station_id = self._search_regex(
r'nStationNo\s*=\s*(\d+)', webpage, 'station')
bbs_id = self._search_regex(
r'nBbsNo\s*=\s*(\d+)', webpage, 'bbs')
video_id = self._search_regex(
r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id)View on GitHub (pinned to 956b8c5855)
Solutions
- Match the numeric RESULT to the table: fix credentials for -1/-3, use the Korean-site account for -7, contact AfreecaTV support for -10/-32008
- Verify the account logs in at the same AfreecaTV domain the URL targets
- Quote --password correctly and re-check for shell interpolation of !, $, @
- For persistent -32008, log in via browser to clear any security challenge, then retry
Example fix
# before youtube-dl --username globaluser --password pass 'http://play.afreecatv.com/xxx' # after youtube-dl --username kruser --password pass 'http://play.afreecatv.com/xxx' # use account for the Korean site
Defensive patterns
Strategy: try-catch
Try / catch
try:
ydl.extract_info(url)
except ExtractorError as e:
msg = str(e)
if 'Unable to login: AfreecaTV' in msg:
if 'Global AfreecaTV' in msg:
switch_to_korean_credentials()
elif 'blocked' in msg or 'Help Center' in msg:
mark_account_needs_manual_review() # -10 / -32008: not automatable
else:
prompt_for_correct_credentials() Prevention
- Use an account registered on the same AfreecaTV domain (kr vs global) as the target URL
- Rate-limit login attempts to avoid triggering the -10 unauthorized-access lock
- Store credentials in netrc rather than CLI flags to avoid quoting mistakes
When it happens
Trigger: POST to AfreecaTV login endpoint returning RESULT -1/-3 (bad credentials), -7 (Global account used on Korean site), -10 (blocked for unauthorized access), -32008 (unspecified login failure), or any code not 1 and not in the table.
Common situations: Typo'd --username/--password; using a global AfreecaTV account against afreecatv.com (Korean); account locked after failed attempts; missing -12 step (security challenge) in newer flows.
Related errors
- We're sorry, but either the User ID or Password entered is n
- Unable to login: %s
- Unable to login: %s
- Unable to login: %s
- Unable to login: %s
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/e50573a33c782c65.
Report an issue: GitHub.