yt-dlp/yt-dlp · error · ExtractorError

{Message}

Error message

{Message}

What it means

Error "{Message}" thrown in yt-dlp/yt-dlp.

Source

Thrown at yt_dlp/extractor/toutv.py:57

    def _perform_login(self, username, password):
        try:
            self._access_token = self._download_json(
                'https://services.radio-canada.ca/toutv/profiling/accounts/login',
                None, 'Logging in', data=json.dumps({
                    'ClientId': self._CLIENT_KEY,
                    'ClientSecret': '34026772-244b-49b6-8b06-317b30ac9a20',
                    'Email': username,
                    'Password': password,
                    'Scope': 'id.write media-validation.read',
                }).encode(), headers={
                    'Authorization': 'client-key ' + self._CLIENT_KEY,
                    'Content-Type': 'application/json;charset=utf-8',
                })['access_token']
        except ExtractorError as e:
            if isinstance(e.cause, HTTPError) and e.cause.status == 401:
                error = self._parse_json(e.cause.response.read().decode(), None)['Message']
                raise ExtractorError(error, expected=True)
            raise
        self._claims = self._call_api('validation/v2/getClaims')['claims']

    def _real_extract(self, url):
        path = self._match_id(url)
        metadata = self._download_json(
            f'https://services.radio-canada.ca/toutv/presentation/{path}', path, query={
                'client_key': self._CLIENT_KEY,
                'device': 'web',
                'version': 4,
            })
        # IsDrm does not necessarily mean the video is DRM protected (see
        # https://github.com/ytdl-org/youtube-dl/issues/13994).
        if not self.get_param('allow_unplayable_formats') and metadata.get('IsDrm'):
            self.report_warning('This video is probably DRM protected.', path)
        video_id = metadata['IdMedia']
        details = metadata['Details']

View on GitHub (pinned to 81ecd58b13)

Solutions

  1. Read the site-reported message
  2. Pass cookies if login is required

When it happens

Trigger: Thrown at yt_dlp/extractor/toutv.py:57 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yt-dlp/yt-dlp@81ecd58b13 (2026-08-22). Data as JSON: /api/errors/46ece7558e2e5d19. Report an issue: GitHub.