AuthManager improvements for multi-account support:
1. Fresh profile support:
- Add use_fresh_profile parameter to setup() and _setup_google_with_patchright()
- Pass through to patchright for new account authentication
- _accounts_add() uses fresh profile to force account selection
2. Symlink management:
- Add quiet parameter to _ensure_storage_state_symlink()
- Call symlink update in __init__ after migration (silent)
- Update symlink on account switch for notebooklm-py compatibility
3. Better integration:
- Symlink now always points to active account's auth file
- Ensures notebooklm-py uses correct credentials after switch
Co-Authored-By: Claude <noreply@anthropic.com>
Display active Google account email and index at the top
of the status output.
Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
- Delegate Google auth file resolution to AccountManager
- Handle add/update account flow in setup
- Maintain backward compatibility with existing API
Co-Authored-By: Claude <noreply@anthropic.com>
Google blocks personal Gmail sign-in with Playwright's bundled Chromium,
showing "This browser or app may not be secure" error. This commit:
- Add patchright_auth.py module using anti-detection Playwright fork
- Route Google auth through Patchright in auth_manager.py
- Add patchright>=1.50.0 to requirements.txt
- Fall back to agent-browser if Patchright unavailable
Key anti-detection techniques:
- ignore_default_args=["--enable-automation"]
- --disable-blink-features=AutomationControlled
- Uses real Chrome via executable_path
- Persistent context for session management
Co-Authored-By: Claude <noreply@anthropic.com>
The notebooklm-py library's download methods use Playwright internally and
look for storage at NOTEBOOKLM_HOME/storage_state.json. This fix:
- Adds _ensure_storage_state_symlink() to create symlink after Google auth
- Symlink points storage_state.json -> google.json in auth directory
- Falls back to file copy on Windows if symlink creation fails
- NOTEBOOKLM_HOME env var already set in config.py to data/auth
Co-Authored-By: Claude <noreply@anthropic.com>
- Complete README rewrite with new nblm identity
- Add npx add-skill installation via vercel-labs/add-skill
- Position as multi-agent skill (Claude Code, Cursor, OpenCode)
- Add tiered command docs (Quick Start + collapsible reference)
- Add acknowledgments for upstream projects
- Update package.json name to nblm
- Replace all "NotebookLM Skill" references across codebase
- Update .gitignore for .claude-plugin/ and docs/plans/
Co-Authored-By: Claude <noreply@anthropic.com>
- Add _extract_and_save_tokens() helper that navigates to NotebookLM before extraction
- Token extraction now happens reliably after successful login (no re-auth needed)
- Fix browser fallback upload to use refs instead of CSS selectors
- Add _find_file_input_ref() to locate upload input in snapshot
- Improve upload flow with better error messages and progress logging
Co-Authored-By: Claude <noreply@anthropic.com>
Implements robust auth strategy based on MCP Server TypeScript implementation:
Auth Architecture Changes:
- Hybrid auth: persistent browser profile (user_data_dir) + manual cookie injection
- Fixes Playwright bug #36139: Session cookies now persist correctly
- Real Chrome via channel="chrome" instead of Chromium (cross-platform reliability)
- Remove automation detection: ignore_default_args=["--enable-automation"]
- Manual cookie injection from state.json for session cookie persistence
Technical Details:
- Python's launch_persistent_context doesn't support storage_state parameter (unlike TypeScript)
- Workaround: Launch with user_data_dir, then manually inject cookies via context.add_cookies()
- Browser profile stores: fingerprint + persistent cookies + cache
- state.json stores: ALL cookies including session cookies (expires=-1)
- This ensures both consistent fingerprinting AND reliable session cookie persistence
Files Changed:
- scripts/ask_question.py: Add hybrid auth + ignore_default_args
- scripts/auth_manager.py: Update setup_auth() and validate_auth() with new approach
- scripts/setup_environment.py: Install Chrome instead of Chromium
- requirements.txt: Add Chrome installation note
- README.md: Add Chrome installation section with rationale
- AUTHENTICATION.md: NEW - Complete auth architecture documentation
Why This Fixes Issue #2:
- Session cookies (without Expires) were lost on restart (Playwright bug)
- Chromium had cross-platform reliability issues
- Manual cookie injection ensures session cookies persist
- Real Chrome ensures consistent behavior across systems
References:
- Playwright Issue #36139: Session cookies not persisting
- Playwright Issue #14949: storage_state with persistent context
- Based on: notebooklm-mcp TypeScript implementation
Add NotebookLM integration skill for Claude Code:
- Browser automation for querying NotebookLM
- Library management for notebook organization
- Persistent authentication with Google
- Zero-hallucination research directly in Claude Code
Based on notebooklm-mcp server, adapted for Claude Skills architecture.