Files
t-youtube/README.md
T

5.0 KiB

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:
    t-youtube/config/cookies.txt
    

2. Configure Environment Variables

Create a .env file in the root directory:

# 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:

docker compose up -d --build

The server will boot up and listen on port 8000.


📁 Repository Structure

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.
  5. Agent Queue: Save videos with notes to a queue for Hermes agents to process (create skills, open issues, etc.)

📚 Documentation

Comprehensive documentation for this project is available in the docs/ folder:

  • Architecture - System overview, components, API endpoints, database schema
  • Progress - Session history, completed tasks, planned features, metrics
  • Configuration - Environment variables, API tokens, database, Authelia, Caddy setup
  • Troubleshooting - Common issues, recovery procedures, monitoring

🚀 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:
    t-youtube/config/cookies.txt
    

2. Configure Environment Variables

Create a .env file in the root directory:

# Optional: Override the fallback OpenAI / Anthropic key
OPENAI_API_KEY=sk-Kq5...rOlx

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:

docker compose up -d --build

The server will boot up and listen on port 8000.