{"record":{"id":"d8b61c80a71c488c","repo":"ytdl-org/youtube-dl","slug":"unable-to-log-in-d8b61c","errorCode":null,"errorMessage":"Unable to log in","messagePattern":"Unable to log in","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/platzi.py","lineNumber":65,"sourceCode":"\n        # login succeeded\n        if 'platzi.com/login' not in urlh.geturl():\n            return\n\n        login_error = self._webpage_read_content(\n            urlh, self._LOGIN_URL, None, 'Downloading login error page')\n\n        login = self._parse_json(\n            self._search_regex(\n                r'login\\s*=\\s*({.+?})(?:\\s*;|\\s*</script)', login_error, 'login'),\n            None)\n\n        for kind in ('error', 'password', 'nonFields'):\n            error = str_or_none(login.get('%sError' % kind))\n            if error:\n                raise ExtractorError(\n                    'Unable to login: %s' % error, expected=True)\n        raise ExtractorError('Unable to log in')\n\n\nclass PlatziIE(PlatziBaseIE):\n    _VALID_URL = r'''(?x)\n                    https?://\n                        (?:\n                            platzi\\.com/clases|           # es version\n                            courses\\.platzi\\.com/classes  # en version\n                        )/[^/]+/(?P<id>\\d+)-[^/?\\#&]+\n                    '''\n\n    _TESTS = [{\n        'url': 'https://platzi.com/clases/1311-next-js/12074-creando-nuestra-primera-pagina/',\n        'md5': '8f56448241005b561c10f11a595b37e3',\n        'info_dict': {\n            'id': '12074',\n            'ext': 'mp4',\n            'title': 'Creando nuestra primera página',","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/platzi.py#L47-L83","documentation":"The fallback Platzi login failure: raised when the post-login page was fetched and parsed successfully but none of the error/password/nonFields fields in the login JSON is set — i.e. the response indicates failure without a specific message. Unlike the sibling errors it is NOT marked expected, so the downloader treats it as an unexpected login failure worth reporting as a bug.","triggerScenarios":"Platzi login POST succeeds at HTTP level but the returned page's login JSON has no error fields — typically an undocumented state: maintenance page, captcha/2FA interstitial, or an A/B login flow the extractor does not recognize.","commonSituations":"Platzi ships a new login flow (e.g. React redirect without the scraped JSON); rate limiting or Cloudflare challenge on the login endpoint; account state like unverified email that shows a non-standard page.","solutions":["Log in manually at platzi.com to rule out account issues (unverified email, captcha, password change)","Export browser cookies and pass --cookies instead of credential login","Update yt-dlp (extractor maintained there) and if current, report the site login change upstream"],"exampleFix":"# before\nyoutube_dl --username me@example.com --password '...' PLATZI_URL\n# after\n# export cookies from a logged-in browser session, then:\nyoutube_dl --cookies cookies.txt PLATZI_URL","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url, username=..., password=...)\nexcept ExtractorError as e:\n    if 'Unable to log in' in str(e):  # not expected → likely site change\n        # fall back to browser-session cookies\n        ydl2 = YoutubeDL({'cookiefile': 'cookies.txt')\n        info = ydl2.extract_info(url)","preventionTips":["Prefer --cookies (browser session) over scripted credential login for Platzi","Watch for this non-expected error as an early signal of a login-flow change","Keep yt-dlp updated; Platzi maintenance happens there"],"tags":["platzi","authentication","login","site-change","extractor-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}