ytdl-org/youtube-dl · error · ExtractorError
This video is DRM protected.
Error message
This video is DRM protected.
What it means
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.
Source
Thrown at youtube_dl/extractor/rai.py:283
'only_matching': True,
}, {
# DRM protected
'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',
'only_matching': True,
}]
def _real_extract(self, url):
base, video_id = re.match(self._VALID_URL, url).groups()
media = self._download_json(
base + '.json', video_id, 'Downloading video JSON')
if try_get(
media,
(lambda x: x['rights_management']['rights']['drm'],
lambda x: x['program_info']['rights_management']['rights']['drm']),
dict):
raise ExtractorError('This video is DRM protected.', expected=True)
title = media['name']
video = media['video']
relinker_info = self._extract_relinker_info(video['content_url'], video_id)
self._sort_formats(relinker_info['formats'])
thumbnails = []
for _, value in media.get('images', {}).items():
if value:
thumbnails.append({
'url': urljoin(url, value),
})
date_published = media.get('date_published')
time_published = media.get('time_published')
if date_published and time_published:View on GitHub (pinned to 956b8c5855)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try:
info = ydl.extract_info(url)
except ExtractorError as e:
if 'DRM protected' in str(e):
skip_permanently(url) Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- This video is DRM protected.
- DRM protected
- This video is DRM protected.
- This video is DRM protected.
- This video is DRM protected.
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/ff114b86ce9bd51b.
Report an issue: GitHub.