# Grok Imagine Favorites Scraper — Design Document
## Overview
A three-pass scraper for `grok.com/imagine/saved` that downloads all favorited
images and videos, along with metadata, into a SQLite database and local files.
---
## Data Model
### Grok Imagine's internal structure
A **favorite** is attached to a **source image**, not a video. When you generate
a video from an image, the image is favorited automatically and all derived
videos are associated with it. The favorites page shows one card per source
image, displaying the most recent video by default.
```
Favorite (source image)
└── preview_image.jpg ← the source image (no play icon overlay)
└── Video 1 (UUID) ← most recent, shown on favorites card
└── Video 2 (UUID) ← older, only visible on detail page
└── Video N (UUID)
```
### Two card types on the favorites page
**Video card:**
- `
` + `