{"record":{"id":"782d2e1eb37d0110","repo":"ytdl-org/youtube-dl","slug":"this-video-is-drm-protected-782d2e","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/shahid.py","lineNumber":122,"sourceCode":"            None, 'Populate Context', data=urlencode_postdata({\n                'firstName': user_data['firstName'],\n                'lastName': user_data['lastName'],\n                'userName': user_data['email'],\n                'csg_user_name': user_data['email'],\n                'subscriberId': user_data['id'],\n                'sessionId': user_data['sessionId'],\n            }))\n\n    def _real_extract(self, url):\n        page_type, video_id = re.match(self._VALID_URL, url).groups()\n        if page_type == 'clip':\n            page_type = 'episode'\n\n        playout = self._call_api(\n            'playout/new/url/' + video_id, video_id)['playout']\n\n        if playout.get('drm'):\n            raise ExtractorError('This video is DRM protected.', expected=True)\n\n        formats = self._extract_m3u8_formats(re.sub(\n            # https://docs.aws.amazon.com/mediapackage/latest/ug/manifest-filtering.html\n            r'aws\\.manifestfilter=[\\w:;,-]+&?',\n            '', playout['url']), video_id, 'mp4')\n        self._sort_formats(formats)\n\n        # video = self._call_api(\n        #     'product/id', video_id, {\n        #         'id': video_id,\n        #         'productType': 'ASSET',\n        #         'productSubType': page_type.upper()\n        #     })['productModel']\n\n        response = self._download_json(\n            'http://api.shahid.net/api/v1_1/%s/%s' % (page_type, video_id),\n            video_id, 'Downloading video JSON', query={\n                'apiKey': 'sh@hid0nlin3',","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/shahid.py#L104-L140","documentation":"Raised by ShahidIE._real_extract when the playout response for the requested asset has a truthy 'drm' flag. Shahid marks subscription/protected streams as DRM, and the extractor refuses them explicitly because the HLS URL it would fetch is unusable without a DRM license. Marked expected=True so users see a clear message instead of a download failure mid-stream.","triggerScenarios":"Calling the Shahid playout API (playout/new/url/<video_id>) for an episode/movie whose playout dict contains 'drm': true (or any truthy value). This correlates with premium Shahid MVP-subscription content; free content returns drm false or omits the key.","commonSituations":"Attempting to download Shahid Premier / MVP exclusive shows without a subscription account; youtube-dl has no account support, so DRM assets always fail; also hit when a previously-free episode moves behind the paywall.","solutions":["Accept that this asset is DRM protected and cannot be downloaded with youtube-dl/yt-dlp anonymous access.","Look for the same content on a non-DRM source (free Shahid episode, MBC YouTube channel, another platform supported by yt-dlp).","Verify with a browser that the asset plays without a subscription; if it does, the extractor's session may lack entitlement - retry with a fresh session (clear cache).","Keep the extractor updated in case Shahid changes the flag semantics."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"playout = call_shahid_playout(video_id)\nif playout.get('drm'):\n    skip_asset(video_id, reason='DRM protected')","typeGuard":"def is_drm_playout(playout):\n    return bool(playout.get('drm'))","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":["Pre-filter premium Shahid assets from download lists.","Never retry DRM errors - they cannot succeed anonymously.","Prefer free/official alternate sources for Shahid originals."],"tags":["drm","shahid","paywall","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}