ytdl-org/youtube-dl · error · ExtractorError

Redirect loop: %s

Error message

Redirect loop: %s

What it means

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.

Source

Thrown at youtube_dl/extractor/ign.py:250

        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        parsed_url = compat_urlparse.urlparse(url)
        embed_url = compat_urlparse.urlunparse(
            parsed_url._replace(path=parsed_url.path.rsplit('/', 1)[0] + '/embed'))

        webpage, urlh = self._download_webpage_handle(embed_url, video_id)
        new_url = urlh.geturl()
        ign_url = compat_parse_qs(
            compat_urlparse.urlparse(new_url).query).get('url', [None])[-1]
        if ign_url:
            return self.url_result(ign_url, IGNIE.ie_key())
        video = self._search_regex(r'(<div\b[^>]+\bdata-video-id\s*=\s*[^>]+>)', webpage, 'video element', fatal=False)
        if not video:
            if new_url == url:
                raise ExtractorError('Redirect loop: ' + url)
            return self.url_result(new_url)
        video = extract_attributes(video)
        video_data = video.get('data-settings') or '{}'
        video_data = self._parse_json(video_data, video_id)['video']
        info = self._extract_video_info(video_data)

        return merge_dicts({
            'display_id': video_id,
        }, info)


class IGNArticleIE(IGNBaseIE):
    _VALID_URL = r'https?://.+?\.ign\.com/(?:articles(?:/\d{4}/\d{2}/\d{2})?|(?:[a-z]{2}/)?(?:[\w-]+/)*?feature/\d+)/(?P<id>[^/?&#]+)'
    _PAGE_TYPE = 'article'
    _TESTS = [{
        'url': 'http://me.ign.com/en/feature/15775/100-little-things-in-gta-5-that-will-blow-your-mind',
        'info_dict': {
            'id': '72113',

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Update youtube-dl/yt-dlp - IGN markup and redirect behavior change frequently and the extractor gets patched.
  2. Try the canonical ign.com video URL (or the videos.ign.com URL) instead of an article/embed link.
  3. Pass a browser-like User-Agent in case IGN is serving a bot-check page.

Example fix

// before
youtube_dl 'https://www.ign.com/articles/some-article'
# => ExtractorError: Redirect loop: ...

// after
# use the direct video page found in the article
youtube_dl --user-agent 'Mozilla/5.0' 'https://www.ign.com/videos/some-video'
Defensive patterns

Strategy: retry

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'Redirect loop' in str(e):
        # markup/anti-bot drift: retry once with a browser UA, else escalate
        ydl.params['http_headers'] = {'User-Agent': 'Mozilla/5.0'}
        ydl.extract_info(url)

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/4135b305908ca24e. Report an issue: GitHub.