{"record":{"id":"7c75f8cca3096459","repo":"ytdl-org/youtube-dl","slug":"this-video-is-only-available-for-premium-users","errorCode":null,"errorMessage":"This video is only available for premium users.","messagePattern":"This video is only available for premium users\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/cda.py","lineNumber":96,"sourceCode":"    def _download_age_confirm_page(self, url, video_id, *args, **kwargs):\n        form_data = random_birthday('rok', 'miesiac', 'dzien')\n        form_data.update({'return': url, 'module': 'video', 'module_id': video_id})\n        data, content_type = multipart_encode(form_data)\n        return self._download_webpage(\n            urljoin(url, '/a/validatebirth'), video_id, *args,\n            data=data, headers={\n                'Referer': url,\n                'Content-Type': content_type,\n            }, **kwargs)\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        self._set_cookie('cda.pl', 'cda.player', 'html5')\n        webpage = self._download_webpage(\n            self._BASE_URL + '/video/' + video_id, video_id)\n\n        if 'Ten film jest dostępny dla użytkowników premium' in webpage:\n            raise ExtractorError('This video is only available for premium users.', expected=True)\n\n        if re.search(r'niedostępn[ey] w(?:&nbsp;|\\s+)Twoim kraju\\s*<', webpage):\n            self.raise_geo_restricted()\n\n        need_confirm_age = False\n        if self._html_search_regex(r'(<form[^>]+action=\"[^\"]*/a/validatebirth[^\"]*\")',\n                                   webpage, 'birthday validate form', default=None):\n            webpage = self._download_age_confirm_page(\n                url, video_id, note='Confirming age')\n            need_confirm_age = True\n\n        formats = []\n\n        uploader = self._search_regex(r'''(?x)\n            <(span|meta)[^>]+itemprop=([\"\\'])author\\2[^>]*>\n            (?:<\\1[^>]*>[^<]*</\\1>|(?!</\\1>)(?:.|\\n))*?\n            <(span|meta)[^>]+itemprop=([\"\\'])name\\4[^>]*>(?P<uploader>[^<]+)</\\3>\n        ''', webpage, 'uploader', default=None, group='uploader')","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/cda.py#L78-L114","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["If you have a CDA Premium account, pass your session cookies: youtube-dl --cookies-from-browser or --cookies cookies.txt.","Otherwise the content is simply not available for anonymous download.","Verify you are extracting the correct video — sometimes mirror/upload URLs differ in entitlement.","Update to yt-dlp in case cda.pl changed its premium marker and a newer extractor handles it."],"exampleFix":"# before\nydl.extract('https://www.cda.pl/video/1234567')  # premium error\n\n# after\nfrom youtube_dl import YoutubeDL\nwith YoutubeDL({'cookiefile': 'cda_cookies.txt'}) as ydl:  # premium session\n    ydl.extract('https://www.cda.pl/video/1234567')","handlingStrategy":"validation","validationCode":"# quick pre-flight: fetch page and check the premium marker\nhtml = http_get('https://www.cda.pl/video/' + video_id)\nif 'dostępny dla użytkowników premium' in html:\n    raise PremiumRequired(video_id)","typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'premium' in str(e).lower():\n        if have_premium_cookies:\n            YoutubeDL({'cookiefile': 'cda.txt'}).extract_info(url)\n        else:\n            skip(url)\n    else:\n        raise","preventionTips":["Pass CDA session cookies for premium accounts.","Classify the premium error as permanent for anonymous setups.","Do not retry premium-gated items without credentials."],"tags":["cda","premium","authentication","polish"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}