{"record":{"id":"52601a7e070ea958","repo":"ytdl-org/youtube-dl","slug":"s-reports-error-s","errorCode":null,"errorMessage":"%s reports error: %s","messagePattern":"(.+?) reports error: (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/niconico.py","lineNumber":422,"sourceCode":"                items = [items]\n            for item in items:\n                ret = xpath_text(video_info_xml, './/' + item)\n                if ret:\n                    return ret\n\n        if get_video_info_xml('error'):\n            error_code = get_video_info_xml('code')\n\n            if error_code == 'DELETED':\n                raise ExtractorError('The video has been deleted.',\n                                     expected=True)\n            elif error_code == 'NOT_FOUND':\n                raise ExtractorError('The video is not found.',\n                                     expected=True)\n            elif error_code == 'COMMUNITY':\n                self.to_screen('%s: The video is community members only.' % video_id)\n            else:\n                raise ExtractorError('%s reports error: %s' % (self.IE_NAME, error_code))\n\n        # Start extracting video formats\n        formats = []\n\n        # Get HTML5 videos info\n        quality_info = try_get(api_data, lambda x: x['media']['delivery']['movie'])\n        if not quality_info:\n            raise ExtractorError('The video can\\'t be downloaded', expected=True)\n\n        for audio_quality in quality_info.get('audios') or {}:\n            for video_quality in quality_info.get('videos') or {}:\n                if not audio_quality.get('isAvailable') or not video_quality.get('isAvailable'):\n                    continue\n                formats.append(self._extract_format_for_quality(\n                    api_data, video_id, audio_quality, video_quality))\n\n        # Get flv/swf info\n        timestamp = None","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/niconico.py#L404-L440","documentation":"Raised by NiconicoIE for any video info XML error code other than DELETED, NOT_FOUND, or COMMUNITY — an unclassified site-side error. The raw code string is appended so users can see what Niconico reported. Not marked expected=True, because the set of possible codes is open-ended.","triggerScenarios":"getthumbinfo XML has a non-empty <error> whose <code> is not one of the three handled values (e.g. 'LOGIN_REQUIRED', 'COMMUNITY_ONLY' variants, or new codes added by the site).","commonSituations":"Premium/member-only videos; temporary Niconico maintenance codes; new error codes introduced after the extractor was written. The literal code tells you which case you have.","solutions":["Inspect the reported code string: login-related codes mean passing cookies (--cookies / --cookies-from-browser, ideally of a premium account).","Retry later if the code looks transient (server maintenance).","Update youtube-dl / yt-dlp so newly seen codes get proper handling and messages."],"exampleFix":"# before\nyoutube-dl 'https://www.nicovideo.jp/watch/sm12345678'\n\n# after (member-only video)\nyoutube-dl --cookies-from-browser firefox 'https://www.nicovideo.jp/watch/sm12345678'","handlingStrategy":"try-catch","validationCode":"import requests, re\nxml = requests.get(f'https://ext.nicovideo.jp/api/getthumbinfo/{video_id}').text\nm = re.search(r'<code>(\\w+)</code>', xml)\nif m and m.group(1) not in ('DELETED', 'NOT_FOUND', 'COMMUNITY'):\n    print('unclassified niconico error:', m.group(1))","typeGuard":null,"tryCatchPattern":"except ExtractorError as e:\n    m = re.search(r'reports error: (\\w+)', str(e))\n    if m:\n        code = m.group(1)\n        if 'LOGIN' in code or 'PREMIUM' in code:\n            retry_with_cookies(url)\n        else:\n            log_unknown_code(code, url)  # candidate for upstream patch\n    else:\n        raise","preventionTips":["Keep a mapping of known niconico error codes to actions (login, retry, give up).","Report unmapped codes upstream so future versions handle them explicitly.","Maintain a logged-in cookie jar for member/premium content."],"tags":["niconico","site-error","authentication","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}