yt-dlp/yt-dlp · error · ExtractorError

Unable to get Auth Token.

Error message

Unable to get Auth Token.

What it means

PokerGoBaseIE._perform_login (yt_dlp/extractor/pokergo.py:25) sends Basic-auth credentials to https://subscription.pokergo.com/properties/<PROPERTY_ID>/sign-in and reads meta.token from the JSON. If the request succeeds but the token is empty/falsy, 'Unable to get Auth Token.' (expected=True) is raised. Note the token is cached in a class attribute _AUTH_TOKEN, and a missing meta/token key would actually KeyError before reaching this check.

Source

Thrown at yt_dlp/extractor/pokergo.py:25

)
from ..utils.traversal import traverse_obj


class PokerGoBaseIE(InfoExtractor):
    _NETRC_MACHINE = 'pokergo'
    _AUTH_TOKEN = None
    _PROPERTY_ID = '1dfb3940-7d53-4980-b0b0-f28b369a000d'

    def _perform_login(self, username, password):
        if self._AUTH_TOKEN:
            return
        self.report_login()
        PokerGoBaseIE._AUTH_TOKEN = self._download_json(
            f'https://subscription.pokergo.com/properties/{self._PROPERTY_ID}/sign-in', None,
            headers={'authorization': f'Basic {base64.b64encode(f"{username}:{password}".encode()).decode()}'},
            data=b'')['meta']['token']
        if not self._AUTH_TOKEN:
            raise ExtractorError('Unable to get Auth Token.', expected=True)

    def _real_initialize(self):
        if not self._AUTH_TOKEN:
            self.raise_login_required(method='password')


class PokerGoIE(PokerGoBaseIE):
    _VALID_URL = r'https?://(?:www\.)?pokergo\.com/videos/(?P<id>[^&$#/?]+)'

    _TESTS = [{
        'url': 'https://www.pokergo.com/videos/2a70ec4e-4a80-414b-97ec-725d9b72a7dc',
        'info_dict': {
            'id': 'aVLOxDzY',
            'ext': 'mp4',
            'title': 'Poker After Dark | Season 12 (2020) | Cry Me a River | Episode 2',
            'description': 'md5:c7a8c29556cbfb6eb3c0d5d622251b71',
            'thumbnail': 'https://cdn.jwplayer.com/v2/media/aVLOxDzY/poster.jpg?width=720',
            'timestamp': 1608085715,

View on GitHub (pinned to 81ecd58b13)

Solutions

  1. Confirm your PokerGO subscription is active by logging in at pokergo.com in a browser.
  2. Re-enter username/password (netrc machine pokergo) to rule out a stale cached token in the same process.
  3. Update yt-dlp; the property id and sign-in endpoint have needed fixes before.
  4. If the failure raises a KeyError instead of this message, report it — the JSON schema changed.
Defensive patterns

Strategy: try-catch

Type guard

from yt_dlp.utils import ExtractorError

def is_pokergo_token_failure(e: BaseException) -> bool:
    """True for the expected empty-token failure after sign-in."""
    return isinstance(e, ExtractorError) and e.expected and 'Unable to get Auth Token' in str(e)

Try / catch

from yt_dlp.utils import ExtractorError

try:
    ydl.download([url])
except ExtractorError as e:
    if e.expected and 'Unable to get Auth Token' in str(e):
        raise CredentialsError('subscription inactive or credentials rejected by pokergo') from e
    raise

Prevention

When it happens

Trigger: Sign-in answers 200 with an empty meta.token — typically an account without an active PokerGO subscription, or credentials the subscription service accepts shape-wise but declines to issue a playback token for. (A hard HTTP 401 would instead surface as a download error before this raise.)

Common situations: Expired or cancelled PokerGO subscription; credentials that work on the marketing site but not subscription.pokergo.com; reused stale _AUTH_TOKEN within a long-lived process after the subscription lapsed.

Related errors


AI-assisted analysis of yt-dlp/yt-dlp@81ecd58b13 (2026-08-22). Data as JSON: /api/errors/e71ad6b38562cec8. Report an issue: GitHub.