Convert web articles into audio podcasts with AI narration. This application scrapes articles, generates high-quality audio using OpenAI's Text-to-Speech API, and creates a podcast feed you can subscribe to in your favorite podcast app.
- Node.js 18.0 or higher
- Python 3.11 or higher
- FFmpeg
- AWS Account with S3 and CloudFront
- OpenAI API key
- Clone the repository:
git clone https://github.com/your-username/url-to-podcast.git
cd url-to-podcast/backend
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the backend directory:
OPENAI_API_KEY=your_openai_key
AWS_ACCESS_KEY_ID=your_aws_key
AWS_SECRET_ACCESS_KEY=your_aws_secret
AWS_BUCKET_NAME=your_bucket_name
CLOUDFRONT_DOMAIN=your_cloudfront_domain
- Start the backend server:
uvicorn main:app --reload
- Navigate to the frontend directory:
cd ../frontend
- Install dependencies:
npm install
- Create a
.env.local
file:
NEXT_PUBLIC_API_URL=http://localhost:8000
- Start the development server:
npm run dev
The application will be available at http://localhost:3000
.
-
Create an S3 bucket:
- Enable public access
- Configure CORS for your domain
-
Set up CloudFront:
- Create a distribution pointing to your S3 bucket
- Enable HTTPS
- Configure appropriate cache behaviors
-
Update your bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket/*"
}
]
}
- Enter an article URL in the input field
- Watch as the content is extracted and formatted in real-time
- Listen to the generated audio directly in the browser
- Copy the RSS feed URL to subscribe in your podcast app
The backend uses FastAPI with the following structure:
backend/
├── services/
│ ├── text_to_speech.py # OpenAI TTS integration
│ ├── storage.py # S3 storage management
│ └── feed.py # RSS feed generation
├── main.py # FastAPI endpoints
└── requirements.txt
The frontend uses Next.js 14 with TypeScript:
frontend/
├── app/
│ └── page.tsx # Main page component
├── components/
│ ├── ui/ # shadcn components
│ └── audio-player.tsx # Audio playback
└── lib/ # Utilities
- OpenAI for the Text-to-Speech API
- shadcn/ui for the component library