Skip to content

Web app for converting a URL into a podcast episode

Notifications You must be signed in to change notification settings

danhilse/url-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL to Podcast Converter

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.

Demo of URL to Podcast Converter

Prerequisites

  • Node.js 18.0 or higher
  • Python 3.11 or higher
  • FFmpeg
  • AWS Account with S3 and CloudFront
  • OpenAI API key

Installation

Backend Setup

  1. Clone the repository:
git clone https://github.com/your-username/url-to-podcast.git
cd url-to-podcast/backend
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. 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
  1. Start the backend server:
uvicorn main:app --reload

Frontend Setup

  1. Navigate to the frontend directory:
cd ../frontend
  1. Install dependencies:
npm install
  1. Create a .env.local file:
NEXT_PUBLIC_API_URL=http://localhost:8000
  1. Start the development server:
npm run dev

The application will be available at http://localhost:3000.

AWS Configuration

  1. Create an S3 bucket:

    • Enable public access
    • Configure CORS for your domain
  2. Set up CloudFront:

    • Create a distribution pointing to your S3 bucket
    • Enable HTTPS
    • Configure appropriate cache behaviors
  3. Update your bucket policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::your-bucket/*"
        }
    ]
}

Usage

  1. Enter an article URL in the input field
  2. Watch as the content is extracted and formatted in real-time
  3. Listen to the generated audio directly in the browser
  4. Copy the RSS feed URL to subscribe in your podcast app

Development

Backend Development

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   

Frontend Development

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

Acknowledgments

  • OpenAI for the Text-to-Speech API
  • shadcn/ui for the component library

About

Web app for converting a URL into a podcast episode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published