{"record":{"id":"e71ad6b38562cec8","repo":"yt-dlp/yt-dlp","slug":"unable-to-get-auth-token","errorCode":null,"errorMessage":"Unable to get Auth Token.","messagePattern":"Unable to get Auth Token\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"yt_dlp/extractor/pokergo.py","lineNumber":25,"sourceCode":")\nfrom ..utils.traversal import traverse_obj\n\n\nclass PokerGoBaseIE(InfoExtractor):\n    _NETRC_MACHINE = 'pokergo'\n    _AUTH_TOKEN = None\n    _PROPERTY_ID = '1dfb3940-7d53-4980-b0b0-f28b369a000d'\n\n    def _perform_login(self, username, password):\n        if self._AUTH_TOKEN:\n            return\n        self.report_login()\n        PokerGoBaseIE._AUTH_TOKEN = self._download_json(\n            f'https://subscription.pokergo.com/properties/{self._PROPERTY_ID}/sign-in', None,\n            headers={'authorization': f'Basic {base64.b64encode(f\"{username}:{password}\".encode()).decode()}'},\n            data=b'')['meta']['token']\n        if not self._AUTH_TOKEN:\n            raise ExtractorError('Unable to get Auth Token.', expected=True)\n\n    def _real_initialize(self):\n        if not self._AUTH_TOKEN:\n            self.raise_login_required(method='password')\n\n\nclass PokerGoIE(PokerGoBaseIE):\n    _VALID_URL = r'https?://(?:www\\.)?pokergo\\.com/videos/(?P<id>[^&$#/?]+)'\n\n    _TESTS = [{\n        'url': 'https://www.pokergo.com/videos/2a70ec4e-4a80-414b-97ec-725d9b72a7dc',\n        'info_dict': {\n            'id': 'aVLOxDzY',\n            'ext': 'mp4',\n            'title': 'Poker After Dark | Season 12 (2020) | Cry Me a River | Episode 2',\n            'description': 'md5:c7a8c29556cbfb6eb3c0d5d622251b71',\n            'thumbnail': 'https://cdn.jwplayer.com/v2/media/aVLOxDzY/poster.jpg?width=720',\n            'timestamp': 1608085715,","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/yt-dlp/yt-dlp/blob/81ecd58b1394793e6da9998cc19fdb45657f1685/yt_dlp/extractor/pokergo.py#L7-L43","documentation":"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.","triggerScenarios":"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.)","commonSituations":"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.","solutions":["Confirm your PokerGO subscription is active by logging in at pokergo.com in a browser.","Re-enter username/password (netrc machine pokergo) to rule out a stale cached token in the same process.","Update yt-dlp; the property id and sign-in endpoint have needed fixes before.","If the failure raises a KeyError instead of this message, report it — the JSON schema changed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"from yt_dlp.utils import ExtractorError\n\ndef is_pokergo_token_failure(e: BaseException) -> bool:\n    \"\"\"True for the expected empty-token failure after sign-in.\"\"\"\n    return isinstance(e, ExtractorError) and e.expected and 'Unable to get Auth Token' in str(e)","tryCatchPattern":"from yt_dlp.utils import ExtractorError\n\ntry:\n    ydl.download([url])\nexcept ExtractorError as e:\n    if e.expected and 'Unable to get Auth Token' in str(e):\n        raise CredentialsError('subscription inactive or credentials rejected by pokergo') from e\n    raise","preventionTips":["Confirm an ACTIVE PokerGO subscription in a browser before scripting downloads.","Note the token is cached on the class — in long-lived processes, restart to force a fresh login.","A KeyError instead of this message means the sign-in JSON schema changed; update yt-dlp."],"tags":["pokergo","login","auth-token","subscription","yt-dlp"],"backgroundTag":"login-failed","analyzedSha":"81ecd58b1394793e6da9998cc19fdb45657f1685","analyzedAt":"2026-08-22T12:21:25.439Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}