A Flask web application for downloading and processing YouTube videos, extracting audio and subtitles.
- Extract audio from YouTube videos
- Generate subtitle/transcript files from videos
- RESTful API for client integration
- Web interface for task management
- Track task status (pending, processing, completed, failed)
- Download processed audio and subtitle files
- Backend: Flask (Python)
- Database: SQLite with SQLAlchemy ORM
- Frontend: HTML, CSS (Bootstrap), JavaScript
- Processing: YouTube-DL/YT-DLP integration
.
├── app.py # Main Flask application entry point
├── config.py # Configuration settings
├── models.py # Database models
├── task_loader.py # Background task processor
├── youtube_content_extractor.py # YouTube processing logic
├── utils.py # Utility functions
├── init_db.py # Database initialization script
├── routes/ # Route blueprints
│ ├── api.py # API endpoints
│ ├── main.py # Main web routes
├── templates/ # HTML templates
├── static/ # Static assets
└── download/ # Downloaded files storage
- Clone this repository:
git clone https://github.com/yourusername/youtube-content-extractor.git
cd youtube-content-extractor- Install dependencies:
pip install -r requirements.txt- Initialize the database:
python init_db.py- Run the application:
python app.pyThe application will be accessible at http://localhost:5000
POST /api/tasks
Content-Type: application/json
{
"youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID"
}
GET /api/tasks/{task_id}
GET /api/tasks
Key configuration options in config.py:
DOWNLOAD_FOLDER: Path to store downloaded filesSQLALCHEMY_DATABASE_URI: Database connection stringSTORAGE_LIMIT: Maximum storage limit for downloadsSUBTITLES_PER_PAGE: Pagination setting for subtitle listing
MIT
Contributions are welcome! Please feel free to submit a Pull Request.