Reclaim time wasted on social media by getting curated summaries instead of endless scrolling.
- YouTube Channel Monitoring: Automatically track and fetch new videos from your favorite channels
- Intelligent Transcript Extraction: Extract video transcripts in multiple languages (English, French, etc.)
- Configurable Video Limits: Control how many videos to process per channel
- Multi-LLM Support: Choose from various AI providers:
- Local Models: LlamaCpp (GGUF models), Ollama (llama2, mistral, codellama, etc.)
- Cloud Providers: Anthropic Claude (Haiku, Sonnet), OpenAI GPT (GPT-5, O4-mini)
- Custom System Prompts: Tailor summaries to your preferences (conversational, technical, brief, etc.)
- Flexible Provider Selection: Use different LLMs for different channels or content types
- Multiple TTS Engines:
- Kokoro TTS: High-quality neural voices (American/British English, multiple voice options)
- Piper TTS: Lightweight, fast synthesis with multi-language support
- Audio Summary Generation: Convert text summaries into audio files for on-the-go listening
- Voice Customization: Choose from various voices and accents
- Telegram Integration: Receive summaries directly in your Telegram chat
- Multi-Bot Support: Configure multiple notification channels for different content types
- Audio Delivery: Get audio summaries sent directly to your messaging app
- Local Caching: Store transcripts and summaries to avoid redundant processing
- SQLite Database: Track processed videos and maintain state across runs
- Incremental Updates: Only process new content since last run
- CLI Interface: Easy-to-use command-line tools for all operations
- Modular Architecture: Clean separation of concerns with pluggable providers
- Extensible Design: Easy to add new platforms, LLMs, or TTS providers
- YAML Configuration: Simple, human-readable configuration files
- Python 3.8+
- FFmpeg (for audio processing)
- Optional: CUDA-capable GPU for faster local LLM inference
# Clone the repository
git clone https://github.com/marouane-dev75/social-summarizer
cd social-summarizer
# Install dependencies
pip install -r requirements.txtCreate a config.local.yml file based on the example below:
# Platform Configuration
platforms:
youtube:
enabled: true
channels:
- name: "TechChannel"
scrap: true
url: "https://www.youtube.com/@TechChannel"
max_videos: 5
language: "en"
cache_folder: "cache_data/youtube_transcripts/tech_channel"
summary:
enabled: true
llm_provider: "ollama_local"
tts_provider: "kokoro_english"
notification_provider: "personal_bot"
system_prompt: |
You are a YouTube video summarizer that creates a single flowing
paragraph in plain text, using natural speech-friendly language
without formatting, symbols, or markdown, presenting the main
topic followed by key points with smooth transitions and ending
with a conclusion.
# Notification Configuration
notifications:
providers:
- name: "personal_bot"
type: "telegram"
enabled: true
config:
bot_token: "YOUR_BOT_TOKEN_HERE" # Get from @BotFather on Telegram
chat_id: "YOUR_CHAT_ID_HERE" # Your Telegram chat ID
timeout_seconds: 30
retry_attempts: 3
# LLM Configuration
llm:
providers:
# Local Ollama instance
- name: "ollama_local"
type: "ollama"
enabled: true
config:
base_url: "http://localhost:11434"
model: "llama2" # or mistral, codellama, etc.
timeout_seconds: 120
generation_config:
temperature: 0.7
num_predict: 4000
top_p: 0.9
top_k: 40
default_system_prompt: "You are a helpful AI assistant."
# Cloud provider example (optional)
- name: "claude_assistant"
type: "anthropic"
enabled: false
config:
api_key: "YOUR_ANTHROPIC_API_KEY"
model: "claude-haiku-4-5"
max_tokens: 4000
temperature: 0.7
# TTS Configuration
tts:
providers:
- name: "kokoro_english"
type: "kokoro"
enabled: true
config:
voice: "af_alloy" # Available: af_heart, af_alloy, af_bella, am_adam, etc.
lang_code: "a" # a = American English, b = British English
repo_id: "hexgrad/Kokoro-82M"
sample_rate: 24000
output_dir: "cache_data/tts"
- name: "piper_french"
type: "piper"
enabled: false
config:
model_path: "/path/to/fr_FR-siwis-medium.onnx"
output_dir: "cache_data/tts"# Process YouTube channels and generate summaries
python main.py youtube process
# Test LLM provider
python main.py llm test --provider ollama_local --prompt "Hello, how are you?"
# Test TTS provider
python main.py tts test --provider kokoro_english --text "This is a test."
# Test notification
python main.py notify test --provider personal_bot --message "Test notification"
# View database info
python main.py db info
# Show version
python main.py versionTimeReclamation/
βββ main.py # Application entry point
βββ requirements.txt # Python dependencies
βββ README.md # This file
β
βββ src/time_reclamation/
β βββ __init__.py # Package initialization
β β
β βββ config/ # Configuration management
β β βββ __init__.py
β β βββ manager.py # Config loader and validator
β β βββ config.yml # Default configuration template
β β βββ config.local.yml # User-specific configuration (gitignored)
β β
β βββ core/ # Core business logic
β β βββ __init__.py
β β βββ youtube/ # YouTube platform implementation
β β βββ __init__.py
β β βββ service.py # Main YouTube service
β β βββ channel_manager.py # Channel operations
β β βββ transcript_fetcher.py # Transcript extraction
β β βββ cache_manager.py # Caching logic
β β βββ summary_service.py # Summary generation
β β βββ database.py # YouTube-specific DB operations
β β
β βββ infrastructure/ # External integrations
β β βββ __init__.py
β β β
β β βββ llm/ # LLM providers
β β β βββ __init__.py
β β β βββ interface.py # LLM provider interface
β β β βββ manager.py # LLM provider manager
β β β βββ providers/
β β β βββ __init__.py
β β β βββ llamacpp.py # LlamaCpp implementation
β β β βββ anthropic.py # Claude implementation
β β β βββ openai.py # OpenAI GPT implementation
β β β βββ ollama.py # Ollama implementation
β β β
β β βββ tts/ # Text-to-Speech providers
β β β βββ __init__.py
β β β βββ interface.py # TTS provider interface
β β β βββ manager.py # TTS provider manager
β β β βββ providers/
β β β βββ __init__.py
β β β βββ kokoro.py # Kokoro TTS implementation
β β β βββ piper.py # Piper TTS implementation
β β β
β β βββ notifications/ # Notification providers
β β β βββ __init__.py
β β β βββ interface.py # Notification provider interface
β β β βββ manager.py # Notification provider manager
β β β βββ providers/
β β β βββ __init__.py
β β β βββ telegram.py # Telegram implementation
β β β
β β βββ database/ # Database management
β β β βββ __init__.py
β β β βββ manager.py # SQLite database manager
β β β
β β βββ logging/ # Logging infrastructure
β β βββ __init__.py
β β βββ logger.py # Centralized logger
β β
β βββ interfaces/ # User interfaces
β βββ __init__.py
β βββ cli/ # Command-line interface
β βββ __init__.py
β βββ manager.py # CLI manager
β βββ command_pattern.py # Command pattern implementation
β βββ commands/ # CLI commands
β βββ __init__.py
β βββ base.py # Base command class
β βββ youtube.py # YouTube commands
β βββ llm.py # LLM commands
β βββ tts.py # TTS commands
β βββ notify_test.py # Notification test command
β βββ summary.py # Summary commands
β βββ db_info.py # Database info command
β βββ version.py # Version command
β
βββ docs/ # Documentation
β βββ llm_system.md # LLM system documentation
β βββ tts_system.md # TTS system documentation
β βββ youtube_system.md # YouTube system documentation
β βββ summary_system.md # Summary system documentation
β
βββ cache_data/ # Runtime data (gitignored)
βββ youtube_transcripts/ # Cached transcripts
βββ tts/ # Generated audio files
βββ state.db # SQLite database
- Provider Pattern: Pluggable LLM, TTS, and notification providers
- Command Pattern: CLI commands with consistent interface
- Manager Pattern: Centralized management of providers and resources
- Repository Pattern: Database abstraction for state management
-
Configuration Layer (
config/manager.py)- YAML-based configuration with validation
- Support for local overrides (config.local.yml)
- Environment-specific settings
-
Core Business Logic (
core/)- Platform-specific implementations (YouTube, Reddit, Twitter)
- Content extraction and processing
- Summary generation orchestration
-
Infrastructure Layer (
infrastructure/)- LLM providers with unified interface
- TTS engines for audio generation
- Notification delivery systems
- Database and logging utilities
-
Interface Layer (
interfaces/cli/)- Command-line interface with subcommands
- User-friendly command structure
- Error handling and feedback
- Language: Python 3.8+
- Configuration: PyYAML
- Database: SQLite3
- LLM Integration:
- llama-cpp-python (local GGUF models)
- anthropic (Claude API)
- openai (GPT API)
- ollama (local/remote Ollama)
- TTS:
- kokoro (neural TTS)
- piper-tts (lightweight TTS)
- Video Processing: yt-dlp
- Notifications: requests (Telegram Bot API)
- Audio: soundfile, numpy, torch
Contributions are welcome! Please feel free to submit a Pull Request.