{"record":{"id":"f88c84c857ece815","repo":"ytdl-org/youtube-dl","slug":"s-is-not-a-video-or-animated-image","errorCode":null,"errorMessage":"%s is not a video or animated image","messagePattern":"(.+?) is not a video or animated image","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/imgur.py","lineNumber":104,"sourceCode":"                         for v in ('width', 'height'))\n        return [{\n            'format_id': tw_id,\n            'url': tw_stream,\n            'ext': ext or determine_ext(tw_stream),\n            'width': width,\n            'height': height,\n        }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        data = self._call_api('media', video_id, fatal=False, expected_status=404)\n        webpage = self._download_webpage(\n            'https://i.imgur.com/{id}.gifv'.format(id=video_id), video_id, fatal=not data) or ''\n\n        if not traverse_obj(data, ('media', 0, (\n                ('type', T(lambda t: t == 'video' or None)),\n                ('metadata', 'is_animated'))), get_all=False):\n            raise ExtractorError(\n                '%s is not a video or animated image' % video_id,\n                expected=True)\n\n        media_fmt = traverse_obj(data, ('media', 0, {\n            'url': ('url', T(url_or_none)),\n            'ext': 'ext',\n            'width': ('width', T(int_or_none)),\n            'height': ('height', T(int_or_none)),\n            'filesize': ('size', T(int_or_none)),\n            'acodec': ('metadata', 'has_sound', T(lambda b: None if b else 'none')),\n        }))\n\n        media_url = traverse_obj(media_fmt, 'url')\n        if media_url:\n            if not media_fmt.get('ext'):\n                media_fmt['ext'] = mimetype2ext(traverse_obj(\n                    data, ('media', 0, 'mime_type'))) or determine_ext(media_url)\n            if traverse_obj(data, ('media', 0, 'type')) == 'image':","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/imgur.py#L86-L122","documentation":"Raised by ImgurIE when the post's API metadata shows it is neither a video nor an animated image - the 'type' is not 'video' and 'metadata'.'is_animated' is falsy. It is an expected error telling the user the imgur ID points at a static picture, which youtube-dl cannot download as media.","triggerScenarios":"Passing an imgur gallery/image URL (https://imgur.com/<id>) whose media entry is a plain JPEG/PNG; the check on ('media', 0, type/is_animated) fails.","commonSituations":"Users copy links to memes/photos on Imgur, or the URL's ID was truncated; also posts that were converted from GIF to static images.","solutions":["Confirm the link is actually a GIF or video in a browser; if it is static, download the image with a plain HTTP client instead.","Use the direct media URL (i.imgur.com/<id>.gifv/.mp4) for animated content.","Check the ID for typos/truncation."],"exampleFix":"// before\nyoutube_dl 'https://imgur.com/abc123'   # static photo\n# => ERROR: abc123 is not a video or animated image\n\n// after\n# fetch the image directly\ncurl -O 'https://i.imgur.com/abc123.jpg'","handlingStrategy":"validation","validationCode":"import requests\ndata = requests.get(f'https://api.imgur.com/v3/media/{imgur_id}', headers={'Authorization': f'Client-ID {client_id}'}, timeout=10).json()\nmedia = data.get('media', [{}])[0]\nif media.get('type') != 'video' and not media.get('metadata', {}).get('is_animated'):\n    skip('static image')","typeGuard":"def is_imgur_video(media_entry: dict) -> bool:\n    return bool(media_entry) and (\n        media_entry.get('type') == 'video'\n        or bool(media_entry.get('metadata', {}).get('is_animated'))\n    )","tryCatchPattern":"try:\n    ydl.extract_info(imgur_url)\nexcept ExtractorError as e:\n    if 'is not a video or animated image' in str(e):\n        download_as_static_image(imgur_url)","preventionTips":["Query Imgur's API first and check type/is_animated before invoking the extractor.","Filter .jpg/.png links out of URL lists at ingestion time.","Treat this as a permanent classification result, never retry."],"tags":["validation","extractor","imgur","media-type","static-image"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}