ytdl-org/youtube-dl · error · ExtractorError

Cannot download file. Are you logged in?

Error message

Cannot download file. Are you logged in?

What it means

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.

Source

Thrown at youtube_dl/extractor/fc2.py:109

        refer = url.replace('/content/', '/a/content/') if '/a/content/' not in url else url

        mimi = hashlib.md5((video_id + '_gGddgPfeaf_gzyr').encode('utf-8')).hexdigest()

        info_url = (
            '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&'.
            format(video_id, mimi, compat_urllib_request.quote(refer, safe=b'').replace('.', '%2E')))

        info_webpage = self._download_webpage(
            info_url, video_id, note='Downloading info page')
        info = compat_urlparse.parse_qs(info_webpage)

        if 'err_code' in info:
            # most of the time we can still download wideo even if err_code is 403 or 602
            self.report_warning(
                'Error code was: %s... but still trying' % info['err_code'][0])

        if 'filepath' not in info:
            raise ExtractorError('Cannot download file. Are you logged in?')

        video_url = info['filepath'][0] + '?mid=' + info['mid'][0]
        title_info = info.get('title')
        if title_info:
            title = title_info[0]

        return {
            'id': video_id,
            'title': title,
            'url': video_url,
            'ext': 'flv',
            'thumbnail': thumbnail,
        }


class FC2EmbedIE(InfoExtractor):
    _VALID_URL = r'https?://video\.fc2\.com/flv2\.swf\?(?P<query>.+)'
    IE_NAME = 'fc2:embed'

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Authenticate with an FC2 account that has access: --username/--password (the FC2 extractor supports login) or --cookies from a logged-in browser session
  2. Verify the video plays anonymously at its FC2 page URL in a browser
  3. Update youtube-dl/yt-dlp in case the info API handshake (mimi parameter) changed
  4. If the video is members-only and you lack an account, no client-side fix exists

Example fix

# before
youtube_dl 'http://video.fc2.com/en/content/20140320/1234567'
# ERROR: Cannot download file. Are you logged in?

# after
youtube_dl --username USER --password PASS 'http://video.fc2.com/en/content/20140320/1234567'
Defensive patterns

Strategy: validation

Validate before calling

# Pre-check with anonymous info request, mirroring the extractor's handshake
import urllib.request, urllib.parse
info_url = 'http://video.fc2.com/ginfo.php?mimi=%s' % computed_mimi
# If the response lacks 'filepath', expect this error and require credentials first

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'Are you logged in' in str(e):
        run_with_credentials(url)  # --username/--password or cookies

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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