ytdl-org/youtube-dl · error · ExtractorError
No login info available, needed for using %s.
Error message
No login info available, needed for using %s.
What it means
Raised by YoutubeIE._login when the extractor has _LOGIN_REQUIRED set (e.g. YoutubeFeedIE and other login-only entry points), username is None from _get_login_info(), and no cookiefile parameter was supplied. It is expected=True: the extractor genuinely cannot proceed without credentials for these URLs.
Source
Thrown at youtube_dl/extractor/youtube.py:224
'SUPPORTS_COOKIES': True,
'WITH_COOKIES': True,
}),
))
def _login(self):
"""
Attempt to log in to YouTube.
True is returned if successful or skipped.
False is returned if login failed.
If _LOGIN_REQUIRED is set and no authentication was provided, an error is raised.
"""
username, password = self._get_login_info()
# No authentication to be performed
if username is None:
if self._LOGIN_REQUIRED and self._downloader.params.get('cookiefile') is None:
raise ExtractorError('No login info available, needed for using %s.' % self.IE_NAME, expected=True)
return True
login_page = self._download_webpage(
self._LOGIN_URL, None,
note='Downloading login page',
errnote='unable to fetch login page', fatal=False)
if login_page is False:
return
login_form = self._hidden_inputs(login_page)
def req(url, f_req, note, errnote):
data = login_form.copy()
data.update({
'pstMsg': 1,
'checkConnection': 'youtube',
'checkedDomains': 'youtube',
'hl': 'en',View on GitHub (pinned to 956b8c5855)
Solutions
- Pass cookies from your browser: --cookies-from-browser chrome/firefox (or export and use --cookies cookies.txt) — the check only requires params['cookiefile'] to be set.
- Alternatively supply --username and --password (or netrc) so _get_login_info returns a username.
- If you intended anonymous extraction, use the plain video/playlist URL (watch?v=...) rather than the feed URL that requires login.
- In API usage of youtube_dl, set 'cookiefile' in the YoutubeDL params before calling extract_info.
Example fix
// before
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.extract_info('https://www.youtube.com/feed/subscriptions')
// after
ydl_opts = {'cookiefile': 'cookies.txt'}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.extract_info('https://www.youtube.com/feed/subscriptions') Defensive patterns
Strategy: validation
Validate before calling
ydl_opts = {'cookiefile': 'cookies.txt'} # set BEFORE extract_info
# or: ydl_opts = {'username': USER, 'password': PASS}
assert ydl_opts.get('cookiefile') or (ydl_opts.get('username') and ydl_opts.get('password')), \
'login-only YouTube URLs need cookies or credentials' Try / catch
try:
info = ydl.extract_info(feed_url)
except ExtractorError as e:
if 'No login info available' in str(e):
raise SystemExit('Pass --cookies-from-browser or --username/--password for feed URLs')
raise Prevention
- Export and reuse a cookies.txt for all login-gated YouTube URLs; it also covers age-restricted videos.
- Prefer --cookies-from-browser while logged in over password login (password login is frequently blocked by YouTube).
When it happens
Trigger: Extracting a YouTube URL handled by a _LOGIN_REQUIRED=True sub-extractor while passing neither --username/--password (or netrc) nor --cookies/--cookies-from-browser(cookiefile param).
Common situations: Running youtube-dl on watch-later, history, or subscription feeds without any auth; CI/docker environments with no cookie jar; assuming the extractor falls back to anonymous access (it deliberately does not for these IEs).
Related errors
- Unable to login: %s
- The video can't be downloaded
- Unable to login. Twitch said: %s
- This video is DRM protected.
- YouTube said: %s
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/6e83a95b2a015352.
Report an issue: GitHub.