{"record":{"id":"17f2debbba6fbce6","repo":"ytdl-org/youtube-dl","slug":"data-message","errorCode":null,"errorMessage":"data['message']","messagePattern":"data\\['message'\\]","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/flickr.py","lineNumber":65,"sourceCode":"        '7': 'No known copyright restrictions',\n        '8': 'United States government work',\n        '9': 'Public Domain Dedication (CC0)',\n        '10': 'Public Domain Work',\n    }\n\n    def _call_api(self, method, video_id, api_key, note, secret=None):\n        query = {\n            'photo_id': video_id,\n            'method': 'flickr.%s' % method,\n            'api_key': api_key,\n            'format': 'json',\n            'nojsoncallback': 1,\n        }\n        if secret:\n            query['secret'] = secret\n        data = self._download_json(self._API_BASE_URL + compat_urllib_parse_urlencode(query), video_id, note)\n        if data['stat'] != 'ok':\n            raise ExtractorError(data['message'])\n        return data\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n\n        api_key = self._download_json(\n            'https://www.flickr.com/hermes_error_beacon.gne', video_id,\n            'Downloading api key')['site_key']\n\n        video_info = self._call_api(\n            'photos.getInfo', video_id, api_key, 'Downloading video info')['photo']\n        if video_info['media'] == 'video':\n            streams = self._call_api(\n                'video.getStreamInfo', video_id, api_key,\n                'Downloading streams info', video_info['secret'])['streams']\n\n            preference = qualities(\n                ['288p', 'iphone_wifi', '100', '300', '700', '360p', 'appletv', '720p', '1080p', 'orig'])","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/flickr.py#L47-L83","documentation":"Raised by the Flickr extractor's _call_api helper when the Flickr API response has stat != 'ok'; the response's own 'message' field is re-raised as the error. This is Flickr's server-side rejection of the API call (photos.getInfo or photos.getSizes), typically for nonexistent/private photos or a bad api_key.","triggerScenarios":"_download_json of self._API_BASE_URL + query returns JSON with stat other than 'ok', then 'raise ExtractorError(data[\"message\"])' runs. Common triggers: photo_id does not exist or was deleted, the photo is private, or the site_key scraped from hermes_error_beacon.gne no longer authorizes API calls.","commonSituations":"Following stale Flickr photo links; extracting photos whose owner flipped them to private; Flickr rotating the public API key embedded in the page after an extractor release.","solutions":["Open the Flickr photo page in a browser to confirm it is public and is a valid photo id","Update youtube-dl/yt-dlp so the api_key bootstrap (site_key from the beacon endpoint) matches Flickr's current page","If the photo is private, log in and supply cookies, or use an authorized API flow","Check the message text: 'Photo not found' means bad id; permission errors mean access, not a bug"],"exampleFix":"# before\nyoutube_dl 'https://www.flickr.com/photos/user/12345678901'\n# ERROR: Photo not found\n\n# after\nyt-dlp 'https://www.flickr.com/photos/user/76543210987'  # existing public photo","handlingStrategy":"validation","validationCode":"# Validate the photo exists and is a video before invoking the extractor\nimport json, urllib.request\nresp = json.load(urllib.request.urlopen(api_url))\nif resp.get('stat') != 'ok':\n    handle_rejection(resp.get('message'))","typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Photo not found' in str(e) or 'permission' in str(e).lower():\n        mark_invalid(url)","preventionTips":["Batch jobs should call flickr.photos.getInfo first and skip non-ok stats","Update the tool so the embedded site_key stays current"],"tags":["flickr","extractor","api-error","invalid-id"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}