{"record":{"id":"4135b305908ca24e","repo":"ytdl-org/youtube-dl","slug":"redirect-loop-s","errorCode":null,"errorMessage":"Redirect loop: %s","messagePattern":"Redirect loop: (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/ign.py","lineNumber":250,"sourceCode":"        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        parsed_url = compat_urlparse.urlparse(url)\n        embed_url = compat_urlparse.urlunparse(\n            parsed_url._replace(path=parsed_url.path.rsplit('/', 1)[0] + '/embed'))\n\n        webpage, urlh = self._download_webpage_handle(embed_url, video_id)\n        new_url = urlh.geturl()\n        ign_url = compat_parse_qs(\n            compat_urlparse.urlparse(new_url).query).get('url', [None])[-1]\n        if ign_url:\n            return self.url_result(ign_url, IGNIE.ie_key())\n        video = self._search_regex(r'(<div\\b[^>]+\\bdata-video-id\\s*=\\s*[^>]+>)', webpage, 'video element', fatal=False)\n        if not video:\n            if new_url == url:\n                raise ExtractorError('Redirect loop: ' + url)\n            return self.url_result(new_url)\n        video = extract_attributes(video)\n        video_data = video.get('data-settings') or '{}'\n        video_data = self._parse_json(video_data, video_id)['video']\n        info = self._extract_video_info(video_data)\n\n        return merge_dicts({\n            'display_id': video_id,\n        }, info)\n\n\nclass IGNArticleIE(IGNBaseIE):\n    _VALID_URL = r'https?://.+?\\.ign\\.com/(?:articles(?:/\\d{4}/\\d{2}/\\d{2})?|(?:[a-z]{2}/)?(?:[\\w-]+/)*?feature/\\d+)/(?P<id>[^/?&#]+)'\n    _PAGE_TYPE = 'article'\n    _TESTS = [{\n        'url': 'http://me.ign.com/en/feature/15775/100-little-things-in-gta-5-that-will-blow-your-mind',\n        'info_dict': {\n            'id': '72113',","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/ign.py#L232-L268","documentation":"Raised by IGN's embed-handling extractor when the /embed version of a page redirects to a URL identical to the original (new_url == url) and no HTML element with data-video-id could be found in the page. The extractor concludes it is stuck in a redirect loop with no video data to parse.","triggerScenarios":"An IGN URL whose path is rewritten to '<path>/embed', the server redirects straight back to the original URL, and the returned webpage contains no <div ... data-video-id=...> element (e.g. a JS-rendered page, a paywall, or a bot check).","commonSituations":"IGN changes its embed routing or serves an anti-bot/JS-only page to youtube-dl's default user agent; the regex for the video element no longer matches after markup changes.","solutions":["Update youtube-dl/yt-dlp - IGN markup and redirect behavior change frequently and the extractor gets patched.","Try the canonical ign.com video URL (or the videos.ign.com URL) instead of an article/embed link.","Pass a browser-like User-Agent in case IGN is serving a bot-check page."],"exampleFix":"// before\nyoutube_dl 'https://www.ign.com/articles/some-article'\n# => ExtractorError: Redirect loop: ...\n\n// after\n# use the direct video page found in the article\nyoutube_dl --user-agent 'Mozilla/5.0' 'https://www.ign.com/videos/some-video'","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Redirect loop' in str(e):\n        # markup/anti-bot drift: retry once with a browser UA, else escalate\n        ydl.params['http_headers'] = {'User-Agent': 'Mozilla/5.0'}\n        ydl.extract_info(url)","preventionTips":["Prefer canonical ign.com/videos/ URLs over article/embed links.","Pin a recent youtube-dl/yt-dlp version and refresh when IGN changes markup.","Log the failing URL and page snapshot when this fires - it indicates extractor drift."],"tags":["redirect","extractor","ign","html-parsing","scraping"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}