{"record":{"id":"79ca39460fabafd0","repo":"ytdl-org/youtube-dl","slug":"cannot-download-file-are-you-logged-in","errorCode":null,"errorMessage":"Cannot download file. Are you logged in?","messagePattern":"Cannot download file\\. Are you logged in\\?","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/fc2.py","lineNumber":109,"sourceCode":"        refer = url.replace('/content/', '/a/content/') if '/a/content/' not in url else url\n\n        mimi = hashlib.md5((video_id + '_gGddgPfeaf_gzyr').encode('utf-8')).hexdigest()\n\n        info_url = (\n            'http://video.fc2.com/ginfo.php?mimi={1:s}&href={2:s}&v={0:s}&fversion=WIN%2011%2C6%2C602%2C180&from=2&otag=0&upid={0:s}&tk=null&'.\n            format(video_id, mimi, compat_urllib_request.quote(refer, safe=b'').replace('.', '%2E')))\n\n        info_webpage = self._download_webpage(\n            info_url, video_id, note='Downloading info page')\n        info = compat_urlparse.parse_qs(info_webpage)\n\n        if 'err_code' in info:\n            # most of the time we can still download wideo even if err_code is 403 or 602\n            self.report_warning(\n                'Error code was: %s... but still trying' % info['err_code'][0])\n\n        if 'filepath' not in info:\n            raise ExtractorError('Cannot download file. Are you logged in?')\n\n        video_url = info['filepath'][0] + '?mid=' + info['mid'][0]\n        title_info = info.get('title')\n        if title_info:\n            title = title_info[0]\n\n        return {\n            'id': video_id,\n            'title': title,\n            'url': video_url,\n            'ext': 'flv',\n            'thumbnail': thumbnail,\n        }\n\n\nclass FC2EmbedIE(InfoExtractor):\n    _VALID_URL = r'https?://video\\.fc2\\.com/flv2\\.swf\\?(?P<query>.+)'\n    IE_NAME = 'fc2:embed'","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/fc2.py#L91-L127","documentation":"Raised by the FC2 extractor when the info page (requested with a computed 'mimi' hash and referer) parses successfully but does not contain a 'filepath' entry, meaning the server did not hand back a media file location. The message points at the most common root cause: the video requires an FC2 account. Notably the extractor tolerates err_code 403/602 and only gives up when filepath itself is absent.","triggerScenarios":"compat_urlparse.parse_qs(info_webpage) yields a dict without 'filepath'. Happens for FC2 member-only/paid videos where the info endpoint returns member data instead of a file path, or when the mimi/referer computation no longer matches what the server expects and it responds with an error body.","commonSituations":"Downloading FC2 adult or premium content without credentials; scraping many video IDs and hitting members-only items; FC2 changing their info API response shape, breaking the extractor's assumptions.","solutions":["Authenticate with an FC2 account that has access: --username/--password (the FC2 extractor supports login) or --cookies from a logged-in browser session","Verify the video plays anonymously at its FC2 page URL in a browser","Update youtube-dl/yt-dlp in case the info API handshake (mimi parameter) changed","If the video is members-only and you lack an account, no client-side fix exists"],"exampleFix":"# before\nyoutube_dl 'http://video.fc2.com/en/content/20140320/1234567'\n# ERROR: Cannot download file. Are you logged in?\n\n# after\nyoutube_dl --username USER --password PASS 'http://video.fc2.com/en/content/20140320/1234567'","handlingStrategy":"validation","validationCode":"# Pre-check with anonymous info request, mirroring the extractor's handshake\nimport urllib.request, urllib.parse\ninfo_url = 'http://video.fc2.com/ginfo.php?mimi=%s' % computed_mimi\n# If the response lacks 'filepath', expect this error and require credentials first","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Are you logged in' in str(e):\n        run_with_credentials(url)  # --username/--password or cookies","preventionTips":["Configure FC2 credentials once in a netrc file instead of per-command","Filter member-only video ids out of bulk queues before extraction"],"tags":["fc2","extractor","authentication","paywall"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}