{"record":{"id":"46ece7558e2e5d19","repo":"yt-dlp/yt-dlp","slug":"message-46ece7","errorCode":null,"errorMessage":"{Message}","messagePattern":"\\{Message\\}","errorType":"exception","errorClass":"ExtractorError","httpStatus":401,"severity":"error","filePath":"yt_dlp/extractor/toutv.py","lineNumber":57,"sourceCode":"\n    def _perform_login(self, username, password):\n        try:\n            self._access_token = self._download_json(\n                'https://services.radio-canada.ca/toutv/profiling/accounts/login',\n                None, 'Logging in', data=json.dumps({\n                    'ClientId': self._CLIENT_KEY,\n                    'ClientSecret': '34026772-244b-49b6-8b06-317b30ac9a20',\n                    'Email': username,\n                    'Password': password,\n                    'Scope': 'id.write media-validation.read',\n                }).encode(), headers={\n                    'Authorization': 'client-key ' + self._CLIENT_KEY,\n                    'Content-Type': 'application/json;charset=utf-8',\n                })['access_token']\n        except ExtractorError as e:\n            if isinstance(e.cause, HTTPError) and e.cause.status == 401:\n                error = self._parse_json(e.cause.response.read().decode(), None)['Message']\n                raise ExtractorError(error, expected=True)\n            raise\n        self._claims = self._call_api('validation/v2/getClaims')['claims']\n\n    def _real_extract(self, url):\n        path = self._match_id(url)\n        metadata = self._download_json(\n            f'https://services.radio-canada.ca/toutv/presentation/{path}', path, query={\n                'client_key': self._CLIENT_KEY,\n                'device': 'web',\n                'version': 4,\n            })\n        # IsDrm does not necessarily mean the video is DRM protected (see\n        # https://github.com/ytdl-org/youtube-dl/issues/13994).\n        if not self.get_param('allow_unplayable_formats') and metadata.get('IsDrm'):\n            self.report_warning('This video is probably DRM protected.', path)\n        video_id = metadata['IdMedia']\n        details = metadata['Details']\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/yt-dlp/yt-dlp/blob/81ecd58b1394793e6da9998cc19fdb45657f1685/yt_dlp/extractor/toutv.py#L39-L75","documentation":"Error \"{Message}\" thrown in yt-dlp/yt-dlp.","triggerScenarios":"Thrown at yt_dlp/extractor/toutv.py:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the site-reported message","Pass cookies if login is required"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81ecd58b1394793e6da9998cc19fdb45657f1685","analyzedAt":"2026-08-22T12:21:25.439Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}