notebooklm-mcp-server 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auth.js CHANGED
@@ -25,22 +25,49 @@ export class AuthManager {
25
25
  let isDone = false;
26
26
  try {
27
27
  await Promise.race([
28
- // Wait for redirect to dashboard or notebook
28
+ // 1. Entering the app (notebook view or dashboard)
29
29
  page.waitForURL(url => url.origin === 'https://notebooklm.google.com' &&
30
30
  (url.pathname.includes('/notebook') || url.pathname === '/'), { timeout: 300000 }).then(() => { isDone = true; }),
31
- // Wait for user icon or other logged-in indicia
32
- page.waitForSelector('button[aria-label*="Account"], img[src*="googleusercontent.com"]', { timeout: 300000 })
31
+ // 2. Main app structure (main role, notebook grid, or aria-labels)
32
+ page.waitForSelector('div[role="main"], .notebook-grid, [aria-label*="Notebook"], [aria-label*="notebook"]', { timeout: 300000 })
33
33
  .then(() => { isDone = true; }),
34
- // Safety fallback: if we see the landing page, we might already be logged in
35
- page.waitForFunction(() => {
36
- const body = document.body.innerText;
37
- return window.location.href.includes('notebooklm.google.com') &&
38
- !body.includes('Sign in') &&
39
- (body.includes('Notebooks') || body.includes('Create new'));
40
- }, { polling: 2000, timeout: 300000 }).then(() => { isDone = true; }),
34
+ // 3. Account indicators (profile pic, logout links)
35
+ page.waitForSelector('button[aria-haspopup="true"] img[src*="googleusercontent.com"], a[href*="logout"], a[href*="Logout"]', { timeout: 300000 })
36
+ .then(() => { isDone = true; }),
37
+ // 4. Fallback: check session cookies (language neutral)
38
+ new Promise((resolve) => {
39
+ const checkLoop = async () => {
40
+ if (isDone)
41
+ return;
42
+ try {
43
+ const cookies = await context.cookies();
44
+ const sid = cookies.find(c => c.name === '__Secure-3PSID' || c.name === 'SID');
45
+ if (sid && page.url().includes('notebooklm.google.com')) {
46
+ isDone = true;
47
+ resolve(true);
48
+ }
49
+ else {
50
+ if (!isDone)
51
+ setTimeout(checkLoop, 2000);
52
+ }
53
+ }
54
+ catch (e) {
55
+ isDone = true;
56
+ }
57
+ };
58
+ checkLoop();
59
+ })
41
60
  ]);
42
- // Small delay to ensure all session cookies are synced
43
- await page.waitForTimeout(2000);
61
+ // Ensure we actually have cookies before proceeding
62
+ const finalCookies = await context.cookies();
63
+ const hasSid = finalCookies.some(c => c.name === '__Secure-3PSID' || c.name === 'SID');
64
+ if (!hasSid) {
65
+ // If we don't have session cookies, we might have just landed on the landing page
66
+ // Wait a bit more or throw to avoid saving empty/expired sessions
67
+ if (onStatus)
68
+ onStatus('Verifying session session...');
69
+ await page.waitForTimeout(3000);
70
+ }
44
71
  }
45
72
  catch (e) {
46
73
  throw new Error('Authentication timed out or browser was closed.');
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ const program = new Command();
4
4
  program
5
5
  .name('notebooklm-mcp-server')
6
6
  .description('NotebookLM MCP Server (Node.js)')
7
- .version('1.1.0');
7
+ .version('1.1.2');
8
8
  program
9
9
  .command('server')
10
10
  .description('Start the MCP server (default)')
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import { AuthManager } from "./auth.js";
6
6
  import chalk from "chalk";
7
7
  const server = new Server({
8
8
  name: "notebooklm-mcp-server",
9
- version: "1.1.0",
9
+ version: "1.1.2",
10
10
  }, {
11
11
  capabilities: {
12
12
  tools: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notebooklm-mcp-server",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Node.js Model Context Protocol server for Google NotebookLM",
5
5
  "type": "module",
6
6
  "repository": {