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

  1. 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.
  2. Alternatively supply --username and --password (or netrc) so _get_login_info returns a username.
  3. If you intended anonymous extraction, use the plain video/playlist URL (watch?v=...) rather than the feed URL that requires login.
  4. 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

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


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/6e83a95b2a015352. Report an issue: GitHub.