Initial commit: Add T YouTube text-based reader web app
- FastAPI backend running on port 8000 - Svelte 5 runes frontend dashboard supporting Read/Skip state toggles - YouTube subscription feed scraper using yt-dlp & Netscape cookies.txt - Transcript downloader and Claude 3.5 Haiku summarizer via bytecatcode proxy - Multi-stage Dockerfile and docker-compose.yml configuration Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
# T YouTube - Text-Based YouTube Digest
|
||||
|
||||
A text-based reader for YouTube. It syncs with your logged-in YouTube subscription feed, fetches video transcripts, generates concise summaries via Claude 3.5 Haiku, and displays them in a Svelte 5 + FastAPI web dashboard.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Setup Instructions
|
||||
|
||||
### 1. Extract your YouTube browser cookies
|
||||
Since YouTube restricts subscription feeds to logged-in users, you need to export your logged-in cookies so `yt-dlp` can request the feed on your behalf:
|
||||
1. Install a browser extension like **Get cookies.txt LOCALLY** (Chrome/Edge) or **cookies.txt** (Firefox).
|
||||
2. Open YouTube in your browser and ensure you are logged in to your account.
|
||||
3. Click the extension icon and export the cookies for `youtube.com` as a Netscape-formatted text file.
|
||||
4. Create a folder named `config` in your project root, rename the exported file to `cookies.txt`, and save it inside:
|
||||
```text
|
||||
t-youtube/config/cookies.txt
|
||||
```
|
||||
|
||||
### 2. Configure Environment Variables
|
||||
Create a `.env` file in the root directory:
|
||||
```env
|
||||
# Optional: Override the fallback OpenAI / Anthropic key
|
||||
OPENAI_API_KEY=sk-Kq5JbgmnEEkdzTqNAQ6bV6nztQ0ngeHTHF9Vg8nUglQvrOlx
|
||||
```
|
||||
|
||||
### 3. Build & Deploy using Docker Compose
|
||||
Run the following command to build the multi-stage image (compiles frontend static assets using Node, then packages backend with Python) and start the container:
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
The server will boot up and listen on port `8000`.
|
||||
|
||||
---
|
||||
|
||||
## 📁 Repository Structure
|
||||
```text
|
||||
t-youtube/
|
||||
├── backend/
|
||||
│ ├── main.py # FastAPI server & endpoints
|
||||
│ ├── db.py # aiosqlite database schema initialization
|
||||
│ ├── fetcher.py # Subscription scraper using yt-dlp
|
||||
│ ├── summarizer.py # Transcript retriever & Claude API client
|
||||
│ └── requirements.txt # Python dependencies
|
||||
├── frontend/
|
||||
│ ├── src/
|
||||
│ │ ├── routes/
|
||||
│ │ │ └── YoutubeDashboard.svelte # Svelte 5 runes UI
|
||||
│ │ ├── App.svelte # Svelte App entry point
|
||||
│ │ └── main.js
|
||||
│ ├── package.json # NPM package definitions
|
||||
│ └── vite.config.js # Vite dev server proxy rules
|
||||
├── Dockerfile # Multi-stage production build script
|
||||
└── docker-compose.yml # Synology NAS deployment config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 Features & Usage
|
||||
|
||||
1. **Sync Subscriptions**: Click the **Sync Subscriptions** button at the top of the dashboard. This triggers a background process that fetches your subscription feed, compares it with the database, adds new entries, extracts transcripts, and generates Claude digests automatically.
|
||||
2. **Fast Reading Layout**: Click on any video card in the sidebar. You will instantly see the channel name, publish date, video length, and the AI-generated digest containing:
|
||||
* **Core Hook (Bolded)**
|
||||
* **Key Takeaways (Bullet list)**
|
||||
* **Actionable Verdict**
|
||||
3. **Read/Skip State**: Mark videos as **Read** or **Skip** to clear them from your pending queue, allowing you to only keep track of what's unread.
|
||||
4. **View Full Transcript**: Expand the accordion at the bottom of the digest to read the raw transcripts if needed.
|
||||
Reference in New Issue
Block a user