{"record":{"id":"bff8e0ee1e021160","repo":"jackwener/OpenCLI","slug":"unexpected-notebooklm-probe-json-stringify-prob","errorCode":null,"errorMessage":"Unexpected NotebookLM probe: ${JSON.stringify(probe)}","messagePattern":"Unexpected NotebookLM probe: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/auth.js","lineNumber":40,"sourceCode":"      }\n      const acctEl = document.querySelector('a[aria-label^=\"Google Account:\"], a[aria-label*=\"Google 账号:\"]');\n      if (!acctEl) {\n        return { kind: 'auth', detail: 'NotebookLM missing Google Account button' };\n      }\n      const label = acctEl.getAttribute('aria-label') || '';\n      const nameMatch = label.match(/Google Account:\\\\s*([^\\\\n\\\\(]+?)(?:\\\\s*\\\\n|\\\\s*\\\\()/i) ||\n                        label.match(/Google 账号:\\\\s*([^\\\\n\\\\(]+?)(?:\\\\s*\\\\n|\\\\s*\\\\()/i);\n      const name = nameMatch ? nameMatch[1].trim() : '';\n      const authuserMatch = location.href.match(/[?&]authuser=(\\\\d+)/);\n      const authuser = authuserMatch ? Number(authuserMatch[1]) : 0;\n      if (!name) {\n        return { kind: 'auth', detail: 'NotebookLM Google Account aria-label found but name unparseable' };\n      }\n      return { ok: true, name, authuser };\n    })()\n  `));\n  if (probe?.kind === 'auth') throw new AuthRequiredError(NOTEBOOKLM_DOMAIN, probe.detail);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected NotebookLM probe: ${JSON.stringify(probe)}`);\n  return { name: probe.name, authuser: probe.authuser };\n}\n\nregisterSiteAuthCommands({\n  site: 'notebooklm',\n  domain: 'google.com',\n  loginUrl: `https://accounts.google.com/ServiceLogin?service=lso&continue=${encodeURIComponent(NOTEBOOKLM_HOME_URL)}`,\n  columns: ['name', 'authuser'],\n  quickCheck: hasNotebookLmSsoCookies,\n  verify: verifyNotebookLmIdentity,\n  poll: async (page) => {\n    if (!await hasNotebookLmSsoCookies(page)) {\n      throw new AuthRequiredError(NOTEBOOKLM_DOMAIN, 'Waiting for Google SSO cookies (SID + SAPISID)');\n    }\n    return verifyNotebookLmIdentity(page);\n  },\n});\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/auth.js#L22-L58","documentation":"The post-login page probe returned an unrecognized shape — not authenticated (kind:'auth') and not a successful identity ({ ok: true, name, authuser }). The library throws CommandExecutionError with the JSON-serialized probe to aid debugging, since it cannot determine login state.","triggerScenarios":"The in-page probe script returns anything other than {kind:'auth'} or {ok:true,...}: e.g. null/undefined evaluate result, an exception payload, or a page where neither the auth chip nor the account label is found.","commonSituations":"NotebookLM DOM changed so probe selectors match nothing; page failed to load (error page, captcha, consent screen); page.evaluate returned undefined due to content-script/CSP changes.","solutions":["Log the full probe JSON from the error message to see what shape came back.","Manually open notebooklm.google.com in the profile and complete any consent/captcha interstitials.","Update the library if NotebookLM's DOM changed (probe selectors no longer match).","Retry after a clean login; transient load failures can produce empty probe results."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await cmd();\n} catch (e) {\n  if (String(e.message).startsWith('Unexpected NotebookLM probe:')) {\n    // inspect probe JSON in the message; clear interstitials / update lib\n    const probe = JSON.parse(e.message.slice('Unexpected NotebookLM probe: '.length));\n    console.error('Probe shape:', probe);\n  }\n  throw e;\n}","preventionTips":["Keep the library updated against NotebookLM DOM changes.","Manually visit notebooklm.google.com to clear consent/captcha screens.","Log the embedded probe JSON whenever this fires to spot new shapes."],"tags":["probe","dom-parsing","notebooklm","unexpected-state"],"backgroundTag":"unexpected-probe-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}