{"record":{"id":"23a7742eda5da007","repo":"ytdl-org/youtube-dl","slug":"error-get-message-or-error-get-error-subcode","errorCode":null,"errorMessage":"error.get('message') or error.get('error_subcode') or error['error_code']","messagePattern":"error\\.get\\('message'\\) or error\\.get\\('error_subcode'\\) or error\\['error_code'\\]","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/brightcove.py","lineNumber":547,"sourceCode":"                if src or streaming_src:\n                    f.update({\n                        'url': src or streaming_src,\n                        'format_id': build_format_id('http' if src else 'http-streaming'),\n                        'source_preference': 0 if src else -1,\n                    })\n                else:\n                    f.update({\n                        'url': app_name,\n                        'play_path': stream_name,\n                        'format_id': build_format_id('rtmp'),\n                    })\n                formats.append(f)\n\n        if not formats:\n            errors = json_data.get('errors')\n            if errors:\n                error = errors[0]\n                raise ExtractorError(\n                    error.get('message') or error.get('error_subcode') or error['error_code'], expected=True)\n            if sources and num_drm_sources == len(sources):\n                raise ExtractorError('This video is DRM protected.', expected=True)\n\n        self._sort_formats(formats)\n\n        for f in formats:\n            f.setdefault('http_headers', {}).update(headers)\n\n        subtitles = {}\n        for text_track in json_data.get('text_tracks', []):\n            if text_track.get('kind') != 'captions':\n                continue\n            text_track_url = url_or_none(text_track.get('src'))\n            if not text_track_url:\n                continue\n            lang = (str_or_none(text_track.get('srclang'))\n                    or str_or_none(text_track.get('label')) or 'en').lower()","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/brightcove.py#L529-L565","documentation":"Raised inside BrightcoveNewIE._real_extract when the playback API returned a JSON payload with an 'errors' array and no playable formats could be built. The message is errors[0].get('message') or error_subcode or error_code — i.e. the raw Brightcove Video Cloud error surfaced to the user. It is marked expected=True, so it is treated as a normal, user-facing failure rather than a bug.","triggerScenarios":"Calling the Brightcove playback API for a videoId whose JSON response contains a non-empty 'errors' list — typical causes: the video was deleted or is unpublished, the policy key does not authorize this video/account, or the video is geo-blocked. Only reached when 'formats' is empty after processing all sources.","commonSituations":"Expired or removed videos; using a policy key extracted from a different player/account than the video belongs to; CDN/API contract changes over time in this old extractor.","solutions":["Verify the video still exists by opening the player URL in a browser.","Make sure the account id in the URL matches the video's account (mismatched account/player pairs produce API errors).","Update to yt-dlp so the current Brightcove API and policy-key extraction are used.","If the message indicates geo restriction, retry from an allowed region or with a proxy (--proxy)."],"exampleFix":"try:\n    info = ydl.extract_info(url, download=False)\nexcept ExtractorError as e:\n    # Brightcove API error text is in str(e); check for known subcodes\n    if 'CLIENT_GEO' in str(e):\n        info = ydl.extract_info(url, download=False, geo_bypass_country='US')\n    else:\n        raise","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    info = ydl.extract_info(url, download=False)\nexcept ExtractorError as e:\n    # e is expected=True; message is Brightcove's own API error text\n    log_user_friendly('video unavailable: %s', e.msg)","preventionTips":["Check the video plays in a browser before batch-downloading.","Match account id in the player URL to the video's account.","Handle expected ExtractorErrors separately from unexpected ones (e.expected flag)."],"tags":["brightcove","api-error","json","expected"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}