{"record":{"id":"146673955448fc98","repo":"ytdl-org/youtube-dl","slug":"login-failed-invalid-username-password","errorCode":null,"errorMessage":"Login failed (invalid username/password)","messagePattern":"Login failed \\(invalid username/password\\)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/tubitv.py","lineNumber":66,"sourceCode":"        },\n    }]\n\n    def _login(self):\n        username, password = self._get_login_info()\n        if username is None:\n            return\n        self.report_login()\n        form_data = {\n            'username': username,\n            'password': password,\n        }\n        payload = urlencode_postdata(form_data)\n        request = sanitized_Request(self._LOGIN_URL, payload)\n        request.add_header('Content-Type', 'application/x-www-form-urlencoded')\n        login_page = self._download_webpage(\n            request, None, False, 'Wrong login info')\n        if not re.search(r'id=\"tubi-logout\"', login_page):\n            raise ExtractorError(\n                'Login failed (invalid username/password)', expected=True)\n\n    def _real_initialize(self):\n        self._login()\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        video_data = self._download_json(\n            'http://tubitv.com/oz/videos/%s/content' % video_id, video_id)\n        title = video_data['title']\n\n        formats = self._extract_m3u8_formats(\n            self._proto_relative_url(video_data['url']),\n            video_id, 'mp4', 'm3u8_native')\n        self._sort_formats(formats)\n\n        thumbnails = []\n        for thumbnail_url in video_data.get('thumbnails', []):","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/tubitv.py#L48-L84","documentation":"Raised by TubiTvIE after a form login when the returned page lacks the id=\"tubi-logout\" marker that indicates an authenticated page: the credentials were rejected. Expected=True, so it is reported as an authentication failure. The login POST goes to tubitv.com with urlencoded username/password.","triggerScenarios":"Passing --username/--password where tubitv.com returns 200 with a login page (no logout element): wrong password, wrong account region, or Tubi's login flow changed (moved to an API/OAuth) so form POST no longer authenticates.","commonSituations":"Stale youtube-dl versions whose Tubi login scraping broke after site redesigns; typos; accounts requiring re-verification. Tubi is also region-locked (US and a few markets), compounding auth issues from other regions.","solutions":["Verify credentials by logging in at tubitv.com in a browser","Switch to cookie auth: log in via browser, then use --cookies-from-browser or --cookies with yt-dlp","Update to yt-dlp, whose TubiTvIE no longer scrapes the old login form","If outside a Tubi market, use a supported-region exit IP"],"exampleFix":"# before: form-based login that no longer works\nyt-dl --username USER --password PASS 'https://tubitv.com/...'\n# after: reuse browser session cookies\nyt-dlp --cookies-from-browser chrome 'https://tubitv.com/...'","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.download([url])\nexcept ExtractorError as e:\n    if e.expected and 'Login failed' in str(e):\n        run(['yt-dlp', '--cookies-from-browser', 'chrome', url])  # cookie fallback","preventionTips":["Use browser cookie auth for Tubi instead of username/password","Verify credentials on tubitv.com before scripting","Extract from a Tubi-supported region"],"tags":["extractor","auth","login","expected"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}