{"record":{"id":"ff114b86ce9bd51b","repo":"ytdl-org/youtube-dl","slug":"this-video-is-drm-protected-ff114b","errorCode":null,"errorMessage":"This video is DRM protected.","messagePattern":"This video is DRM protected\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/rai.py","lineNumber":283,"sourceCode":"        'only_matching': True,\n    }, {\n        # DRM protected\n        'url': 'https://www.raiplay.it/video/2020/09/Lo-straordinario-mondo-di-Zoey-S1E1-Lo-straordinario-potere-di-Zoey-ed493918-1d32-44b7-8454-862e473d00ff.html',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        base, video_id = re.match(self._VALID_URL, url).groups()\n\n        media = self._download_json(\n            base + '.json', video_id, 'Downloading video JSON')\n\n        if try_get(\n                media,\n                (lambda x: x['rights_management']['rights']['drm'],\n                 lambda x: x['program_info']['rights_management']['rights']['drm']),\n                dict):\n            raise ExtractorError('This video is DRM protected.', expected=True)\n\n        title = media['name']\n\n        video = media['video']\n\n        relinker_info = self._extract_relinker_info(video['content_url'], video_id)\n        self._sort_formats(relinker_info['formats'])\n\n        thumbnails = []\n        for _, value in media.get('images', {}).items():\n            if value:\n                thumbnails.append({\n                    'url': urljoin(url, value),\n                })\n\n        date_published = media.get('date_published')\n        time_published = media.get('time_published')\n        if date_published and time_published:","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/rai.py#L265-L301","documentation":"RaiIE._real_extract downloads the video JSON at {base}.json and raises ExtractorError('This video is DRM protected.', expected=True) when try_get finds a dict at either media['rights_management']['rights']['drm'] or media['program_info']['rights_management']['rights']['drm']. Rai marks some content (films, premium) with DRM rights metadata, which youtube-dl cannot process, so it aborts before resolving the relinker URL.","triggerScenarios":"Extracting a raiplay.it/rai.it video whose JSON metadata includes a non-empty drm object under rights_management.rights (checked at two possible locations, since the key lives under program_info on some page types).","commonSituations":"RaiPlay movies and flagship series that are fair-play/Widevine protected; users pasting links from the RaiPlay apps; content that moved from free to premium/DRM after a rights change.","solutions":["No youtube-dl-side workaround — DRM streams cannot be extracted; use RaiPlay's official player.","Check whether a free, unprotected version of the same content exists (different episode/clip URL).","Update youtube-dl in case the DRM-flag interpretation or JSON layout changed.","Skip such URLs in automated runs by catching this expected error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'DRM protected' in str(e):\n        skip_permanently(url)","preventionTips":["Prefer free Rai content; DRM titles cannot be extracted by design.","Catch and filter this expected error in batch runners instead of letting it abort the queue.","Do not retry DRM errors."],"tags":["rai","drm","licensing","expected-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}