ytdl-org/youtube-dl · error · ExtractorError
Login failed (invalid username/password)
Error message
Login failed (invalid username/password)
What it means
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.
Source
Thrown at youtube_dl/extractor/tubitv.py:66
},
}]
def _login(self):
username, password = self._get_login_info()
if username is None:
return
self.report_login()
form_data = {
'username': username,
'password': password,
}
payload = urlencode_postdata(form_data)
request = sanitized_Request(self._LOGIN_URL, payload)
request.add_header('Content-Type', 'application/x-www-form-urlencoded')
login_page = self._download_webpage(
request, None, False, 'Wrong login info')
if not re.search(r'id="tubi-logout"', login_page):
raise ExtractorError(
'Login failed (invalid username/password)', expected=True)
def _real_initialize(self):
self._login()
def _real_extract(self, url):
video_id = self._match_id(url)
video_data = self._download_json(
'http://tubitv.com/oz/videos/%s/content' % video_id, video_id)
title = video_data['title']
formats = self._extract_m3u8_formats(
self._proto_relative_url(video_data['url']),
video_id, 'mp4', 'm3u8_native')
self._sort_formats(formats)
thumbnails = []
for thumbnail_url in video_data.get('thumbnails', []):View on GitHub (pinned to 956b8c5855)
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
Example fix
# before: form-based login that no longer works yt-dl --username USER --password PASS 'https://tubitv.com/...' # after: reuse browser session cookies yt-dlp --cookies-from-browser chrome 'https://tubitv.com/...'
Defensive patterns
Strategy: fallback
Try / catch
try:
ydl.download([url])
except ExtractorError as e:
if e.expected and 'Login failed' in str(e):
run(['yt-dlp', '--cookies-from-browser', 'chrome', url]) # cookie fallback Prevention
- Use browser cookie auth for Tubi instead of username/password
- Verify credentials on tubitv.com before scripting
- Extract from a Tubi-supported region
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unable to login: %s
- error (parsed JSON 'Message' from 401 response)
- error_msg (xpath_text(auth, 'error/msg'))
- Unable to log in
- Bigo says: %s (code %s)
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/146673955448fc98.
Report an issue: GitHub.