{"record":{"id":"a640b163bfdfc98e","repo":"ytdl-org/youtube-dl","slug":"this-video-is-drm-protected-a640b1","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/sonyliv.py","lineNumber":79,"sourceCode":"                video_id, headers=headers)['resultObj']\n        except ExtractorError as e:\n            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:\n                message = self._parse_json(\n                    e.cause.read().decode(), video_id)['message']\n                if message == 'Geoblocked Country':\n                    self.raise_geo_restricted(countries=self._GEO_COUNTRIES)\n                raise ExtractorError(message)\n            raise\n\n    def _real_initialize(self):\n        self._TOKEN = self._call_api('1.4', 'ALL/GETTOKEN', None)\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        content = self._call_api(\n            '1.5', 'IN/CONTENT/VIDEOURL/VOD/' + video_id, video_id)\n        if content.get('isEncrypted'):\n            raise ExtractorError('This video is DRM protected.', expected=True)\n        dash_url = content['videoURL']\n        headers = {\n            'x-playback-session-id': '%s-%d' % (uuid.uuid4().hex, time.time() * 1000)\n        }\n        formats = self._extract_mpd_formats(\n            dash_url, video_id, mpd_id='dash', headers=headers, fatal=False)\n        formats.extend(self._extract_m3u8_formats(\n            dash_url.replace('.mpd', '.m3u8').replace('/DASH/', '/HLS/'),\n            video_id, 'mp4', m3u8_id='hls', headers=headers, fatal=False))\n        for f in formats:\n            f.setdefault('http_headers', {}).update(headers)\n        self._sort_formats(formats)\n\n        metadata = self._call_api(\n            '1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata']\n        title = metadata['title']\n        episode = metadata.get('episodeTitle')\n        if episode and title != episode:","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/sonyliv.py#L61-L97","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Accept the limit: DRM-protected SonyLIV content is not downloadable with youtube-dl/yt-dlp.","Check whether the same title exists on a free/clear source supported by yt-dlp.","Verify with a fresh token (update yt-dlp, clear cache) - a failed token can occasionally mislabel requests.","Do not waste time retrying; the DRM flag is deterministic per asset."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"content = sonyliv_content_url(video_id)\nif content.get('isEncrypted'):\n    skip(video_id, reason='DRM')","typeGuard":"def is_encrypted_content(content: dict) -> bool:\n    return bool(content.get('isEncrypted'))","tryCatchPattern":"try:\n    extract(url)\nexcept ExtractorError as e:\n    if 'DRM protected' in str(e):\n        mark_unextractable(video_id)\n    else:\n        raise","preventionTips":["Exclude SonyLIV originals/premium and live TV from job lists.","Never retry DRM errors - deterministic per asset.","Keep yt-dlp current for token handling that affects the isEncrypted response."],"tags":["drm","sonyliv","paywall","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}