ytdl-org/youtube-dl · error · ExtractorError

error

Error message

error

What it means

Raised by FunimationNow's _login when the auth API (prod-api-funimationnow.dadcdigital.com/api/auth/login/) returns HTTP 401 and the body's 'error' field is surfaced verbatim as an expected error. A 401 on this endpoint means the credentials were rejected (or the account lacks access); the token assignment never happens.

Source

Thrown at youtube_dl/extractor/funimation.py:75

        'only_matching': True,
    }]

    def _login(self):
        username, password = self._get_login_info()
        if username is None:
            return
        try:
            data = self._download_json(
                'https://prod-api-funimationnow.dadcdigital.com/api/auth/login/',
                None, 'Logging in', data=urlencode_postdata({
                    'username': username,
                    'password': password,
                }))
            self._TOKEN = data['token']
        except ExtractorError as e:
            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
                error = self._parse_json(e.cause.read().decode(), None)['error']
                raise ExtractorError(error, expected=True)
            raise

    def _real_initialize(self):
        self._login()

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)

        def _search_kane(name):
            return self._search_regex(
                r"KANE_customdimensions\.%s\s*=\s*'([^']+)';" % name,
                webpage, name, default=None)

        title_data = self._parse_json(self._search_regex(
            r'TITLE_DATA\s*=\s*({[^}]+})',
            webpage, 'title data', default=''),
            display_id, js_to_json, fatal=False) or {}

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Confirm credentials work at funimation.com (or note the service migration — content moved to Crunchyroll, so use that extractor where applicable)
  2. Update to yt-dlp: the Funimation auth flow changed near end-of-life and youtube-dl is frozen
  3. Use --cookies from a logged-in browser session instead of password auth
  4. Verify the subscription tier includes the requested show/region

Example fix

# before
youtube_dl --username me@example.com --password bad 'https://www.funimation.com/en/shows/x/'
# ERROR: Invalid credentials

# after
yt-dlp --cookies funi_cookies.txt 'https://www.funimation.com/en/shows/x/'
Defensive patterns

Strategy: try-catch

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if caused_by_401(e):  # login rejected
        stop_retrying(url)  # wrong credentials; fix auth, no point retrying

Prevention

When it happens

Trigger: _download_json of the login endpoint with username/password raises ExtractorError with a compat_HTTPError cause of code 401; the JSON body's 'error' string is re-raised. Triggered by wrong --username/--password, a locked account, or Funimation auth changes after the service's Sony/Crunchyroll migration.

Common situations: Stored credentials going stale after Funization's shutdown/migration to Crunchyroll; typos in netrc files; free accounts trying to reach subscriber content.

Related errors


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