diff --git a/yt_dlp/extractor/brightcove.py b/yt_dlp/extractor/brightcove.py index 3ada1fd5de..d4ac7a0c28 100644 --- a/yt_dlp/extractor/brightcove.py +++ b/yt_dlp/extractor/brightcove.py @@ -923,10 +923,18 @@ class BrightcoveNewIE(BrightcoveNewBaseIE): errors = json_data.get('errors') if errors and errors[0].get('error_subcode') == 'TVE_AUTH': custom_fields = json_data['custom_fields'] + missing_fields = ', '.join( + key for key in ('source_url', 'software_statement') if not smuggled_data.get(key)) + if missing_fields: + raise ExtractorError( + f'Missing fields in smuggled data: {missing_fields}. ' + f'This video can be only extracted from the webpage where it is embedded. ' + f'Pass the URL of the embedding webpage instead of the Brightcove URL', expected=True) tve_token = self._extract_mvpd_auth( smuggled_data['source_url'], video_id, custom_fields['bcadobepassrequestorid'], - custom_fields['bcadobepassresourceid']) + custom_fields['bcadobepassresourceid'], + smuggled_data['software_statement']) json_data = self._download_json( api_url, video_id, headers={ 'Accept': f'application/json;pk={policy_key}',