{"record":{"id":"828efe3375a7fcdb","repo":"ytdl-org/youtube-dl","slug":"err-msg","errorCode":null,"errorMessage":"err.msg","messagePattern":"err\\.msg","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/niconico.py","lineNumber":457,"sourceCode":"        # Get flv/swf info\n        timestamp = None\n        video_real_url = try_get(api_data, lambda x: x['video']['smileInfo']['url'])\n        if video_real_url:\n            is_economy = video_real_url.endswith('low')\n\n            if is_economy:\n                self.report_warning('Site is currently in economy mode! You will only have access to lower quality streams')\n\n            # Invoking ffprobe to determine resolution\n            pp = FFmpegPostProcessor(self._downloader)\n            cookies = self._get_cookies('https://nicovideo.jp').output(header='', sep='; path=/; domain=nicovideo.jp;\\n')\n\n            self.to_screen('%s: %s' % (video_id, 'Checking smile format with ffprobe'))\n\n            try:\n                metadata = pp.get_metadata_object(video_real_url, ['-cookies', cookies])\n            except PostProcessingError as err:\n                raise ExtractorError(err.msg, expected=True)\n\n            v_stream = a_stream = {}\n\n            # Some complex swf files doesn't have video stream (e.g. nm4809023)\n            for stream in metadata['streams']:\n                if stream['codec_type'] == 'video':\n                    v_stream = stream\n                elif stream['codec_type'] == 'audio':\n                    a_stream = stream\n\n            # Community restricted videos seem to have issues with the thumb API not returning anything at all\n            filesize = int(\n                (get_video_info_xml('size_high') if not is_economy else get_video_info_xml('size_low'))\n                or metadata['format']['size']\n            )\n            extension = (\n                get_video_info_xml('movie_type')\n                or 'mp4' if 'mp4' in metadata['format']['format_name'] else metadata['format']['format_name']","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/niconico.py#L439-L475","documentation":"Raised while probing the legacy 'smile' (FLV/SWF) stream: FFmpegPostProcessor.get_metadata_object() throws a PostProcessingError and its .msg is re-raised as an expected ExtractorError. The underlying message almost always comes from ffprobe — most commonly that the ffprobe/ffmpeg binary is missing or not executable. It is expected=True only in the wrapping sense; the root cause is local environment.","triggerScenarios":"The watch API supplies a smileInfo.url, the extractor invokes ffprobe with session cookies to determine codec streams, and get_metadata_object raises PostProcessingError (ffprobe not found, probe failure, or unreadable stream).","commonSituations":"ffmpeg/ffprobe not installed or not on PATH (the classic cause); ffprobe version too old for the stream; session cookies expired so the probe URL returns an error page.","solutions":["Install ffmpeg (which bundles ffprobe) or point youtube-dl at it: --ffmpeg-location <path>.","Verify with 'ffprobe -version' that ffprobe runs and is a recent build.","Re-login and refresh cookies if the probe URL itself is being rejected (expired session)."],"exampleFix":"# before: err.msg like 'ffprobe not found'\nyoutube-dl 'https://www.nicovideo.jp/watch/sm9'\n\n# after\n youtube-dl --ffmpeg-location /usr/local/bin/ffmpeg 'https://www.nicovideo.jp/watch/sm9'\n# or: brew install ffmpeg / apt install ffmpeg","handlingStrategy":"validation","validationCode":"import shutil, subprocess\nffprobe = shutil.which('ffprobe')\nif not ffprobe:\n    raise SystemExit('install ffmpeg/ffprobe before downloading legacy niconico videos')\nsubprocess.run([ffprobe, '-version'], check=True)","typeGuard":null,"tryCatchPattern":"except ExtractorError as e:\n    if 'ffprobe' in str(e) or 'ffmpeg' in str(e).lower():\n        fix_ffmpeg_env()  # install or set --ffmpeg-location, then retry\n    else:\n        raise","preventionTips":["Verify ffprobe/ffmpeg are installed and on PATH before any niconico run.","Pass --ffmpeg-location explicitly in containerized deployments.","Refresh cookies if ffprobe fails on the URL itself rather than at launch."],"tags":["ffmpeg","ffprobe","environment","niconico","configuration"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}