{"record":{"id":"e50573a33c782c65","repo":"ytdl-org/youtube-dl","slug":"unable-to-login-s-said-s","errorCode":null,"errorMessage":"Unable to login: %s said: %s","messagePattern":"Unable to login: (.+?) said: (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/afreecatv.py","lineNumber":219,"sourceCode":"            -4: 'Your account has been suspended due to a violation of our terms and policies.',\n            -5: 'https://member.afreecatv.com/app/user_delete_progress.php',\n            -6: 'https://login.afreecatv.com/membership/changeMember.php',\n            -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.\",\n            -9: 'https://member.afreecatv.com/app/pop_login_block.php',\n            -11: 'https://login.afreecatv.com/afreeca/second_login.php',\n            -12: 'https://member.afreecatv.com/app/user_security.php',\n            0: 'The username does not exist or you have entered the wrong password.',\n            -1: 'The username does not exist or you have entered the wrong password.',\n            -3: 'You have entered your username/password incorrectly.',\n            -7: 'You cannot use your Global AfreecaTV account to access Korean AfreecaTV.',\n            -10: 'Sorry for the inconvenience. \\nYour account has been blocked due to an unauthorized access. \\nPlease contact our Help Center for assistance.',\n            -32008: 'You have failed to log in. Please contact our Help Center.',\n        }\n\n        result = int_or_none(response.get('RESULT'))\n        if result != 1:\n            error = _ERRORS.get(result, 'You have failed to log in.')\n            raise ExtractorError(\n                'Unable to login: %s said: %s' % (self.IE_NAME, error),\n                expected=True)\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n\n        webpage = self._download_webpage(url, video_id)\n\n        if re.search(r'alert\\([\"\\']This video has been deleted', webpage):\n            raise ExtractorError(\n                'Video %s has been deleted' % video_id, expected=True)\n\n        station_id = self._search_regex(\n            r'nStationNo\\s*=\\s*(\\d+)', webpage, 'station')\n        bbs_id = self._search_regex(\n            r'nBbsNo\\s*=\\s*(\\d+)', webpage, 'bbs')\n        video_id = self._search_regex(\n            r'nTitleNo\\s*=\\s*(\\d+)', webpage, 'title', default=video_id)","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/afreecatv.py#L201-L237","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nyoutube-dl --username globaluser --password pass 'http://play.afreecatv.com/xxx'\n\n# after\nyoutube-dl --username kruser --password pass 'http://play.afreecatv.com/xxx'  # use account for the Korean site","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    msg = str(e)\n    if 'Unable to login: AfreecaTV' in msg:\n        if 'Global AfreecaTV' in msg:\n            switch_to_korean_credentials()\n        elif 'blocked' in msg or 'Help Center' in msg:\n            mark_account_needs_manual_review()  # -10 / -32008: not automatable\n        else:\n            prompt_for_correct_credentials()","preventionTips":["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"],"tags":["afreecatv","authentication","login","credentials"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}