ytdl-org/youtube-dl · error · ExtractorError

This song is blocked in this region

Error message

This song is blocked in this region

What it means

Raised by the Kuwo extractor when the antiserver.kuwo.cn/anti.s URL-resolution endpoint replies with the literal string 'IPDeny' instead of a media URL, meaning the song's CDN refuses the requester's IP region. It is expected=True and geo-related; Kuwo enforces regional licensing on a per-song basis.

Source

Thrown at youtube_dl/extractor/kuwo.py:45

    def _get_formats(self, song_id, tolerate_ip_deny=False):
        formats = []
        for file_format in self._FORMATS:
            query = {
                'format': file_format['ext'],
                'br': file_format.get('br', ''),
                'rid': 'MUSIC_%s' % song_id,
                'type': 'convert_url',
                'response': 'url'
            }

            song_url = self._download_webpage(
                'http://antiserver.kuwo.cn/anti.s',
                song_id, note='Download %s url info' % file_format['format'],
                query=query, headers=self.geo_verification_headers(),
            )

            if song_url == 'IPDeny' and not tolerate_ip_deny:
                raise ExtractorError('This song is blocked in this region', expected=True)

            if song_url.startswith('http://') or song_url.startswith('https://'):
                formats.append({
                    'url': song_url,
                    'format_id': file_format['format'],
                    'format': file_format['format'],
                    'preference': file_format['preference'],
                    'abr': file_format.get('abr'),
                })

        return formats


class KuwoIE(KuwoBaseIE):
    IE_NAME = 'kuwo:song'
    IE_DESC = '酷我音乐'
    _VALID_URL = r'https?://(?:www\.)?kuwo\.cn/yinyue/(?P<id>\d+)'
    _TESTS = [{

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Route traffic through a mainland-China (or otherwise licensed-region) proxy/VPN and retry
  2. Use a different source for the song (other licensed platform or region-free mirror)
  3. Pick a different quality/format that is not geo-fenced, by inspecting which format request returned IPDeny
  4. If you only need metadata/lyrics, fetch the song page directly instead of downloading audio
Defensive patterns

Strategy: fallback

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'blocked in this region' in str(e):
        retry_through_regional_proxy(url)  # or fall back to another source
    else:
        raise

Prevention

When it happens

Trigger: Calling the Kuwo song (or MV) extractor from an IP outside the licensed region for that song: the convert_url request with query rid=MUSIC_<song_id>&response=url returns exactly 'IPDeny'. Only raised when tolerate_ip_deny is False (the plain song extractor); the MV extractor tolerates it and proceeds without those formats.

Common situations: Running youtube-dl on kuwo.cn songs from outside mainland China; VPN exit nodes in unlicensed regions; songs licensed only regionally (many Mandopop catalog items); CI runners hosted abroad hitting geo-fenced tracks.

Related errors


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