ytdl-org/youtube-dl · error · ExtractorError

Unable to login: incorrect username and/or password

Error message

Unable to login: incorrect username and/or password

What it means

Raised by the Zattoo extractor when the login POST to /zapi/v2/account/login returns HTTP 400, which the Zattoo API uses to signal that the supplied login/password pair was rejected. The ExtractorError is marked expected=True so it is reported as an authentication failure, not a crash.

Source

Thrown at youtube_dl/extractor/zattoo.py:47

        if not username or not password:
            self.raise_login_required(
                'A valid %s account is needed to access this media.'
                % self._NETRC_MACHINE)

        try:
            data = self._download_json(
                '%s/zapi/v2/account/login' % self._host_url(), None, 'Logging in',
                data=urlencode_postdata({
                    'login': username,
                    'password': password,
                    'remember': 'true',
                }), headers={
                    'Referer': '%s/login' % self._host_url(),
                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
                })
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 400:
                raise ExtractorError(
                    'Unable to login: incorrect username and/or password',
                    expected=True)
            raise

        self._power_guide_hash = data['session']['power_guide_hash']

    def _real_initialize(self):
        webpage = self._download_webpage(
            self._host_url(), None, 'Downloading app token')
        app_token = self._html_search_regex(
            r'appToken\s*=\s*(["\'])(?P<token>(?:(?!\1).)+?)\1',
            webpage, 'app token', group='token')
        app_version = self._html_search_regex(
            r'<!--\w+-(.+?)-', webpage, 'app version', default='2.8.2')

        # Will setup appropriate cookies
        self._request_webpage(
            '%s/zapi/v2/session/hello' % self._host_url(), None,

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Verify the credentials by logging into the Zattoo web player in a browser with the same username/password
  2. If using --netrc, check ~/.netrc has a 'zattoo' machine entry with the correct login and password
  3. Reset the password on the Zattoo website if it was changed or forgotten
  4. Confirm the account has a subscription that covers the channel/region you are downloading

Example fix

# before
youtube-dl --username me@example.com --password wrongpass https://zattoo.com/...
# after (verified credentials, or netrc)
youtube-dl --netrc https://zattoo.com/...
Defensive patterns

Strategy: try-catch

Try / catch

try:
    ydl.download([url])
except ExtractorError as e:
    if 'Unable to login' in str(e):
        # credentials rejected: do NOT retry with the same pair
        notify_user('Check Zattoo credentials / netrc entry')
    else:
        raise

Prevention

When it happens

Trigger: Extracting any Zattoo URL with --username/--password (or netrc) where the credentials are wrong, the account was locked/deleted, or the password contains characters mangled by shell quoting. Any HTTP 400 from the login endpoint maps to this single message.

Common situations: Expired or changed password; credentials stored in ~/.netrc with wrong permissions or stale entries; account not entitled to the requested channel/region; typos from manual --username/--password entry.

Related errors


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