{"record":{"id":"dd553adcfc691d28","repo":"ytdl-org/youtube-dl","slug":"youku-said-sorry-this-video-is-available-in-chin","errorCode":null,"errorMessage":"Youku said: Sorry, this video is available in China only","messagePattern":"Youku said: Sorry, this video is available in China only","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/youku.py","lineNumber":180,"sourceCode":"\n        video_password = self._downloader.params.get('videopassword')\n        if video_password:\n            basic_data_params['password'] = video_password\n\n        headers = {\n            'Referer': url,\n        }\n        headers.update(self.geo_verification_headers())\n        data = self._download_json(\n            'https://ups.youku.com/ups/get.json', video_id,\n            'Downloading JSON metadata',\n            query=basic_data_params, headers=headers)['data']\n\n        error = data.get('error')\n        if error:\n            error_note = error.get('note')\n            if error_note is not None and '因版权原因无法观看此视频' in error_note:\n                raise ExtractorError(\n                    'Youku said: Sorry, this video is available in China only', expected=True)\n            elif error_note and '该视频被设为私密' in error_note:\n                raise ExtractorError(\n                    'Youku said: Sorry, this video is private', expected=True)\n            else:\n                msg = 'Youku server reported error %i' % error.get('code')\n                if error_note is not None:\n                    msg += ': ' + error_note\n                raise ExtractorError(msg)\n\n        # get video title\n        video_data = data['video']\n        title = video_data['title']\n\n        formats = [{\n            'url': stream['m3u8_url'],\n            'format_id': self.get_format_name(stream.get('stream_type')),\n            'ext': 'mp4',","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/youku.py#L162-L198","documentation":"Raised by the Youku extractor when the ups.youku.com/get.json API returns an error whose note contains '因版权原因无法观看此视频' ('this video cannot be viewed for copyright reasons'). Youku licenses much of its catalog for mainland China only, so foreign IPs get this copyright/geo error.","triggerScenarios":"Downloading any Youku video while ups.youku.com returns data.error with a note containing the Chinese copyright string; the check runs before title extraction, after the JSON metadata request with geo verification headers.","commonSituations":"Accessing Youku shows/movies from outside mainland China; VPNs exiting in non-CN regions; content whose China-only license is actively enforced.","solutions":["Route through a mainland-China IP (the content is licensed for CN only).","If already in China, ensure no proxy/VPN is intercepting the request.","Find the title on an international service if one holds your region's rights."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept GeoRestrictedError:\n    mark_geo_blocked(url, countries=['CN'])\nexcept ExtractorError as e:\n    if 'available in China only' in str(e):\n        mark_geo_blocked(url, countries=['CN'])\n    else:\n        raise","preventionTips":["Route Youku traffic through a mainland-China IP.","Check that no VPN/proxy leaks a foreign IP — geo detection happens server-side at ups.youku.com.","Distinguish this copyright error from the sibling 'private video' error; only the latter is unfixable by region."],"tags":["geo-restriction","licensing","extractor","youku","china"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}