{"record":{"id":"065699681abcd4d0","repo":"ytdl-org/youtube-dl","slug":"unable-to-log-in-065699","errorCode":null,"errorMessage":"Unable to log in","messagePattern":"Unable to log in","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/teachable.py","lineNumber":101,"sourceCode":"                'Referer': login_url,\n            })\n\n        if '>I accept the new Privacy Policy<' in response:\n            raise ExtractorError(\n                'Unable to login: %s asks you to accept new Privacy Policy. '\n                'Go to https://%s/ and accept.' % (site, site), expected=True)\n\n        # Successful login\n        if is_logged(response):\n            self._logged_in = True\n            return\n\n        message = get_element_by_class('alert', response)\n        if message is not None:\n            raise ExtractorError(\n                'Unable to login: %s' % clean_html(message), expected=True)\n\n        raise ExtractorError('Unable to log in')\n\n\nclass TeachableIE(TeachableBaseIE):\n    _VALID_URL = r'''(?x)\n                    (?:\n                        %shttps?://(?P<site_t>[^/]+)|\n                        https?://(?:www\\.)?(?P<site>%s)\n                    )\n                    /courses/[^/]+/lectures/(?P<id>\\d+)\n                    ''' % TeachableBaseIE._VALID_URL_SUB_TUPLE\n\n    _TESTS = [{\n        'url': 'https://gns3.teachable.com/courses/gns3-certified-associate/lectures/6842364',\n        'info_dict': {\n            'id': 'untlgzk1v7',\n            'ext': 'bin',\n            'title': 'Overview',\n            'description': 'md5:071463ff08b86c208811130ea1c2464c',","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/teachable.py#L83-L119","documentation":"Raised by TeachableBaseIE._login as the final fallback: the login POST returned neither the privacy-policy marker, nor a logged-in session (is_logged false), nor any 'alert' element. Unlike the sibling errors it is NOT marked expected=True, so youtube-dl reports it as an unexpected extractor failure.","triggerScenarios":"The site returns a login response with an unrecognized shape — no alert div, not logged in — e.g. the school changed its login template, returned a CAPTCHA/interstitial, or the POST endpoint moved.","commonSituations":"Teachable platform updates that alter the login page markup; custom-skinned schools whose login flow differs; bot-protection challenges on the login POST.","solutions":["Open the site's /login in a browser and confirm the login form flow still matches (one-step email/password, no CAPTCHA).","Use browser cookies instead: export cookies.txt for the site and pass --cookies so the extractor skips _login entirely.","Upgrade youtube-dl (or switch to yt-dlp, which maintains the Teachable extractor) — login-flow changes are patched upstream.","If it must work, reproduce the login POST with curl/requests and update the form parsing in _login."],"exampleFix":"# before: rely on CLI credential login\n# youtube-dl --username u --password p https://school.teachable.com/courses/x/lectures/1\n# after: reuse an authenticated browser session\n# 1) log in in the browser, export cookies (cookies.txt)\n# youtube-dl --cookies cookies.txt https://school.teachable.com/courses/x/lectures/1","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Unable to log in' in str(e):\n        # login flow unrecognized: fall back to a browser session\n        run_with_cookies(url, 'cookies.txt')\n    else:\n        raise","preventionTips":["Prefer --cookies from a logged-in browser for Teachable sites; CLI login is brittle.","Upgrade to yt-dlp when Teachable login markup changes.","This error is NOT expected-flagged: report it upstream with the site URL."],"tags":["login","unexpected-error","teachable","site-change"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}