ytdl-org/youtube-dl · error · ExtractorError

This video is only available for premium users.

Error message

This video is only available for premium users.

What it means

Raised by CDAIE when the video page contains the Polish string 'Ten film jest dostępny dla użytkowników premium'. cda.pl marks premium-only videos server-side in the HTML, and the extractor refuses with this expected error instead of failing later with no formats.

Source

Thrown at youtube_dl/extractor/cda.py:96

    def _download_age_confirm_page(self, url, video_id, *args, **kwargs):
        form_data = random_birthday('rok', 'miesiac', 'dzien')
        form_data.update({'return': url, 'module': 'video', 'module_id': video_id})
        data, content_type = multipart_encode(form_data)
        return self._download_webpage(
            urljoin(url, '/a/validatebirth'), video_id, *args,
            data=data, headers={
                'Referer': url,
                'Content-Type': content_type,
            }, **kwargs)

    def _real_extract(self, url):
        video_id = self._match_id(url)
        self._set_cookie('cda.pl', 'cda.player', 'html5')
        webpage = self._download_webpage(
            self._BASE_URL + '/video/' + video_id, video_id)

        if 'Ten film jest dostępny dla użytkowników premium' in webpage:
            raise ExtractorError('This video is only available for premium users.', expected=True)

        if re.search(r'niedostępn[ey] w(?:&nbsp;|\s+)Twoim kraju\s*<', webpage):
            self.raise_geo_restricted()

        need_confirm_age = False
        if self._html_search_regex(r'(<form[^>]+action="[^"]*/a/validatebirth[^"]*")',
                                   webpage, 'birthday validate form', default=None):
            webpage = self._download_age_confirm_page(
                url, video_id, note='Confirming age')
            need_confirm_age = True

        formats = []

        uploader = self._search_regex(r'''(?x)
            <(span|meta)[^>]+itemprop=(["\'])author\2[^>]*>
            (?:<\1[^>]*>[^<]*</\1>|(?!</\1>)(?:.|\n))*?
            <(span|meta)[^>]+itemprop=(["\'])name\4[^>]*>(?P<uploader>[^<]+)</\3>
        ''', webpage, 'uploader', default=None, group='uploader')

View on GitHub (pinned to 956b8c5855)

Solutions

  1. If you have a CDA Premium account, pass your session cookies: youtube-dl --cookies-from-browser or --cookies cookies.txt.
  2. Otherwise the content is simply not available for anonymous download.
  3. Verify you are extracting the correct video — sometimes mirror/upload URLs differ in entitlement.
  4. Update to yt-dlp in case cda.pl changed its premium marker and a newer extractor handles it.

Example fix

# before
ydl.extract('https://www.cda.pl/video/1234567')  # premium error

# after
from youtube_dl import YoutubeDL
with YoutubeDL({'cookiefile': 'cda_cookies.txt'}) as ydl:  # premium session
    ydl.extract('https://www.cda.pl/video/1234567')
Defensive patterns

Strategy: validation

Validate before calling

# quick pre-flight: fetch page and check the premium marker
html = http_get('https://www.cda.pl/video/' + video_id)
if 'dostępny dla użytkowników premium' in html:
    raise PremiumRequired(video_id)

Try / catch

from youtube_dl.utils import ExtractorError
try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'premium' in str(e).lower():
        if have_premium_cookies:
            YoutubeDL({'cookiefile': 'cda.txt'}).extract_info(url)
        else:
            skip(url)
    else:
        raise

Prevention

When it happens

Trigger: Downloading any cda.pl video whose page shows the premium notice — the content requires a paid CDA Premium subscription. Detection is plain substring matching on the downloaded page.

Common situations: Premium movies/series hosted on cda.pl; also users who ARE logged in as premium in a browser but not in youtube-dl (no session cookie passed).

Related errors


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