{"record":{"id":"398ab3b66b3abc2a","repo":"ytdl-org/youtube-dl","slug":"unable-to-login-incorrect-username-and-or-passwor-398ab3","errorCode":null,"errorMessage":"Unable to login: incorrect username and/or password","messagePattern":"Unable to login: incorrect username and/or password","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/zattoo.py","lineNumber":47,"sourceCode":"        if not username or not password:\n            self.raise_login_required(\n                'A valid %s account is needed to access this media.'\n                % self._NETRC_MACHINE)\n\n        try:\n            data = self._download_json(\n                '%s/zapi/v2/account/login' % self._host_url(), None, 'Logging in',\n                data=urlencode_postdata({\n                    'login': username,\n                    'password': password,\n                    'remember': 'true',\n                }), headers={\n                    'Referer': '%s/login' % self._host_url(),\n                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n                })\n        except ExtractorError as e:\n            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 400:\n                raise ExtractorError(\n                    'Unable to login: incorrect username and/or password',\n                    expected=True)\n            raise\n\n        self._power_guide_hash = data['session']['power_guide_hash']\n\n    def _real_initialize(self):\n        webpage = self._download_webpage(\n            self._host_url(), None, 'Downloading app token')\n        app_token = self._html_search_regex(\n            r'appToken\\s*=\\s*([\"\\'])(?P<token>(?:(?!\\1).)+?)\\1',\n            webpage, 'app token', group='token')\n        app_version = self._html_search_regex(\n            r'<!--\\w+-(.+?)-', webpage, 'app version', default='2.8.2')\n\n        # Will setup appropriate cookies\n        self._request_webpage(\n            '%s/zapi/v2/session/hello' % self._host_url(), None,","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/zattoo.py#L29-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the credentials by logging into the Zattoo web player in a browser with the same username/password","If using --netrc, check ~/.netrc has a 'zattoo' machine entry with the correct login and password","Reset the password on the Zattoo website if it was changed or forgotten","Confirm the account has a subscription that covers the channel/region you are downloading"],"exampleFix":"# before\nyoutube-dl --username me@example.com --password wrongpass https://zattoo.com/...\n# after (verified credentials, or netrc)\nyoutube-dl --netrc https://zattoo.com/...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.download([url])\nexcept ExtractorError as e:\n    if 'Unable to login' in str(e):\n        # credentials rejected: do NOT retry with the same pair\n        notify_user('Check Zattoo credentials / netrc entry')\n    else:\n        raise","preventionTips":["Store Zattoo credentials in ~/.netrc (machine zattoo login ... password ...) with chmod 600","Verify credentials in a browser before wiring them into automation","Treat HTTP 400 on login as terminal — retrying identical credentials will not succeed"],"tags":["zattoo","authentication","credentials","http-400"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}