import subprocess import json notebook_id = "e8a30630-0df2-4932-8740-9ffe7d8882bc" nlm_bin = "/opt/ai-os/products/ceo/integrations/notebooklm-mcp-cli/.venv/bin/nlm" # Explicit IDs to delete (the duplicate PR, Ch.X.pdf and old GM Ch1) ids_to_delete = [ "63e8ccb1-d278-40be-80b9-88ebc0dda5ea", # GM, Ch.1- 10 Ly Thuyet Kinh Te Hoc.pdf "90370a26-d2b2-4c39-9b49-c1dc5d2e893d", # PR, Ch.10.pdf "431c92a3-5a4c-4ba4-ac38-6ce91c6f9408", # PR, Ch.12.pdf "e334f692-f821-4261-929d-3a919c09f98d", # PR, Ch.16.pdf "0dd01aed-7f52-46b5-8413-0e5dbc77e262", # PR, Ch.17.pdf "63f32ced-003f-4941-844e-26fe77ac0d53", # PR, Ch.18.pdf "7b86bf58-94a2-4567-b3c9-e659368eb8ab", # PR, Ch.3.pdf "6b6183af-ada1-443b-ac9e-588427d3e697", # PR, Ch.6.pdf "8e6108f0-1e14-4c26-9e83-b86d33cc21cc", # PR, Ch.7.pdf "51f00b3e-0418-487f-8b5c-60f611769664", # PR, Ch.8.pdf "3f083f7a-887d-4d98-8387-ca49e845e592", # PR, Ch.9.pdf ] for sid in ids_to_delete: r = subprocess.run([nlm_bin, "source", "delete", notebook_id, sid], capture_output=True, text=True) print(f"Delete {sid}: code={r.returncode}, out={r.stdout.strip()}, err={r.stderr.strip()}") # Rename the 2 newly added # fa4b9d4b-b4d6-4c00-848d-8c685ee6ceb3 -> [1411] PR, Ch. 2 - Những nguyên lý cơ bản của cung và cầu.pdf # 149bc9e2-e6a9-41b8-aeb6-ac55f84103f5 -> [2511] PR, Ch. 11 - Định giá khi có sức mạnh thị trường.pdf subprocess.run([nlm_bin, "source", "rename", "--notebook", notebook_id, "fa4b9d4b-b4d6-4c00-848d-8c685ee6ceb3", "[1411] PR, Ch. 2 - Những nguyên lý cơ bản của cung và cầu.pdf"]) subprocess.run([nlm_bin, "source", "rename", "--notebook", notebook_id, "149bc9e2-e6a9-41b8-aeb6-ac55f84103f5", "[2511] PR, Ch. 11 - Định giá khi có sức mạnh thị trường.pdf"])