Lang-Graph is an automation pipeline designed to scrape AI/Tech news, enhance articles using OpenAI, generate YouTube Shorts scripts, create audio narrations, and produce videos using Json2Video and FFmpeg.
- News Scraping: Scrapes AI/Tech news from multiple sources like TechCrunch, The Verge, and VentureBeat.
- Article Enhancement: Uses OpenAI to summarize, categorize, and score articles.
- Excel Report: Creates a structured Excel report of the articles.
- YouTube Shorts Script: Generates engaging scripts optimized for YouTube Shorts.
- Audio Narration: Creates audio using ElevenLabs or system TTS.
- Video Creation: Produces videos with synchronized subtitles and visuals using Json2Video and FFmpeg.
Set the following environment variables before running the project:
OPENAI_API_KEY: Your OpenAI API key for article enhancement and script generation.ELEVENLABS_API_KEY: (Optional) ElevenLabs API key for audio generation.VIDEO_OUTPUT_DIR: Directory where output files (Excel, audio, video) will be saved.JSON2VIDEO_API_KEY: Json2Video API key for video creation.UNSPLASH_API_KEY: (Optional) Unsplash API key for image search.
Example:
export OPENAI_API_KEY="your-openai-api-key"
export ELEVENLABS_API_KEY="your-elevenlabs-api-key"
export VIDEO_OUTPUT_DIR="/path/to/output"
export JSON2VIDEO_API_KEY="your-json2video-api-key"
export UNSPLASH_API_KEY="your-unsplash-api-key"-
Clone the Repository:
git clone https://github.com/your-repo/lang-graph.git cd lang-graph -
Set Up Virtual Environment:
python3 -m venv .venv source .venv/bin/activate -
Install Dependencies:
pip install -r requirements.txt
-
Install FFmpeg:
- Mac:
brew install ffmpeg - Linux:
sudo apt install ffmpeg - Windows: Download from FFmpeg.org.
- Mac:
If you prefer to run the pipeline directly without Uvicorn:
-
Run the Pipeline:
python scripts/runner.py
-
Outputs:
- Excel Report: Saved in the
VIDEO_OUTPUT_DIR. - Audio File: Generated narration saved in the
VIDEO_OUTPUT_DIR. - Video File: Final video saved in the
VIDEO_OUTPUT_DIR.
- Excel Report: Saved in the
The project can be run as an API using Uvicorn.
-
Install Uvicorn:
pip install uvicorn
-
Run the API:
uv run runner.py
- OpenAI: Get your API key.
- ElevenLabs: Get your API key.
- Json2Video: Get your API key.
- Unsplash: Get your API key.
export OPENAI_API_KEY="your-openai-api-key"
export ELEVENLABS_API_KEY="your-elevenlabs-api-key"
export VIDEO_OUTPUT_DIR="/path/to/output"
export JSON2VIDEO_API_KEY="your-json2video-api-key"
export UNSPLASH_API_KEY="your-unsplash-api-key"- ElevenLabs: If not available, the pipeline will use system TTS or create silent audio files.
- Json2Video: Ensure your API key is valid for video creation.
- FFmpeg: Required for video merging and fallback video creation.
-
Missing API Keys: Ensure all required environment variables are set.
-
FFmpeg Not Found: Install FFmpeg and ensure it is added to your system's PATH.
-
Json2Video Errors: Verify the payload structure and API key validity.