feat: download NotebookLM infographics → upload to Sanity assets#616
Merged
codercatdev merged 3 commits intodevfrom Mar 5, 2026
Merged
feat: download NotebookLM infographics → upload to Sanity assets#616codercatdev merged 3 commits intodevfrom
codercatdev merged 3 commits intodevfrom
Conversation
…wnloads Co-authored-by: research <research@miriad.systems>
… reusable for blog posts) Co-authored-by: research <research@miriad.systems>
… check-research - Import writeClient from sanity-write-client - Download PNGs with authenticated fetch using NotebookLM cookies - Upload to Sanity via writeClient.assets.upload() - Store image refs in infographics array field on doc - Keep backward-compat CDN URLs in researchData.infographicUrls - Graceful error handling per infographic (try/catch) Co-authored-by: research <research@miriad.systems>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Downloads infographic images from NotebookLM and uploads them to Sanity assets, making them available as first-class image references in the CMS — reusable for blog posts and video b-roll.
Changes
1. Schema:
sanity/schemas/documents/automatedVideo.tsinfographicsarray field (visible, not hidden) betweenshortUrlandrenderDataimagetype withhotspot,alttext, andcaptionfields2. Route:
app/api/cron/check-research/route.tswriteClientfrom@/lib/sanity-write-clientstepInfographicsGenerating, replaced the URL-only collection loop with:getInfographicUrl()writeClient.assets.upload('image', buffer, { filename })_type: 'image'refs for theinfographicsarray fieldresearchData.infographicUrlsfor backward compatinfographicsarray (image refs) andresearchData(CDN URLs)3. Client:
lib/services/notebooklm/client.tsgetCookieHeader()method to expose the auth cookie header for authenticated image downloadsBefore → After
Before: Stored auth-gated
lh3.googleusercontent.comURLs that expire and require Google auth to access.After: Images are downloaded and uploaded to Sanity CDN — permanent, public URLs. Image refs stored in the
infographicsarray field for direct use in Sanity Studio, blog posts, and Remotion compositions.Verification
npx tsc --noEmit— clean for all modified files (only pre-existing error in unrelatedsanity-revalidateroute)shortUrl, beforerenderDataresearchData.infographicUrls