ytdl-org/youtube-dl · error · ExtractorError

This video is DRM protected.

Error message

This video is DRM protected.

What it means

SonyLIVIE._real_extract calls the VOD URL endpoint and checks content['isEncrypted']. A truthy value means the stream is Widevine/PlayReady protected DASH, which youtube-dl cannot decrypt, so it raises 'This video is DRM protected.' as an expected error before attempting MPD parsing.

Source

Thrown at youtube_dl/extractor/sonyliv.py:79

                video_id, headers=headers)['resultObj']
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
                message = self._parse_json(
                    e.cause.read().decode(), video_id)['message']
                if message == 'Geoblocked Country':
                    self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
                raise ExtractorError(message)
            raise

    def _real_initialize(self):
        self._TOKEN = self._call_api('1.4', 'ALL/GETTOKEN', None)

    def _real_extract(self, url):
        video_id = self._match_id(url)
        content = self._call_api(
            '1.5', 'IN/CONTENT/VIDEOURL/VOD/' + video_id, video_id)
        if content.get('isEncrypted'):
            raise ExtractorError('This video is DRM protected.', expected=True)
        dash_url = content['videoURL']
        headers = {
            'x-playback-session-id': '%s-%d' % (uuid.uuid4().hex, time.time() * 1000)
        }
        formats = self._extract_mpd_formats(
            dash_url, video_id, mpd_id='dash', headers=headers, fatal=False)
        formats.extend(self._extract_m3u8_formats(
            dash_url.replace('.mpd', '.m3u8').replace('/DASH/', '/HLS/'),
            video_id, 'mp4', m3u8_id='hls', headers=headers, fatal=False))
        for f in formats:
            f.setdefault('http_headers', {}).update(headers)
        self._sort_formats(formats)

        metadata = self._call_api(
            '1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata']
        title = metadata['title']
        episode = metadata.get('episodeTitle')
        if episode and title != episode:

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Accept the limit: DRM-protected SonyLIV content is not downloadable with youtube-dl/yt-dlp.
  2. Check whether the same title exists on a free/clear source supported by yt-dlp.
  3. Verify with a fresh token (update yt-dlp, clear cache) - a failed token can occasionally mislabel requests.
  4. Do not waste time retrying; the DRM flag is deterministic per asset.
Defensive patterns

Strategy: validation

Validate before calling

content = sonyliv_content_url(video_id)
if content.get('isEncrypted'):
    skip(video_id, reason='DRM')

Type guard

def is_encrypted_content(content: dict) -> bool:
    return bool(content.get('isEncrypted'))

Try / catch

try:
    extract(url)
except ExtractorError as e:
    if 'DRM protected' in str(e):
        mark_unextractable(video_id)
    else:
        raise

Prevention

When it happens

Trigger: Requesting IN/CONTENT/VIDEOURL/VOD/<video_id> for premium SonyLIV content (SonyLIV Specials, live TV channels, some movies) where the API sets isEncrypted true. The accompanying videoURL is an encrypted DASH manifest that yields no playable formats.

Common situations: Trying to download SonyLIV originals/premium shows without (or even with) a subscription - anonymous extraction never has DRM keys; live TV always DRM'd; free ad-supported content occasionally flagged after licensing changes.

Related errors


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