YouTubeExtractor is a Python application used to download videos or entire playlists from YouTube. It supports downloading audio-only or audio with video, saving files in MP3 or MP4 formats. Optionally, it can save metadata to a database (SQLite by default, with support for MySQL and PostgreSQL).
YoutubeExtractor leverages the powerful yt-dlp library.
NOTE: Downloading videos or audio of content you do not own might be illegal in your country. This program is intended for educational purposes only. The author is not responsible for any misuse of this program.
Run the program and enter the YouTube URL for either a playlist or a single video. Then select whether to download audio only or audio and video, and whether to write metadata to the database.
By default, metadata is stored in a local SQLite database. If you choose to use MySQL or PostgreSQL, ensure you have the respective database installed and configured. The program will automatically create necessary tables if they do not exist.
Downloaded media files are saved automatically to the data/ folder.
-
Clone the repository to your local machine:
git clone https://github.com/Pymetheus/YoutubeExtractor.git
-
Change into the project directory:
cd YoutubeExtractor
-
Update the API keys in the config.ini
cd YoutubeExtractor\.config
-
Setup virtual environment and install requirements.txt
python -m venv .venv source .venv/bin/activate python -m pip install -r requirements.txt
-
Run program
python src\main.py
The application code is organized under the src/ directory, split into three modules:
- main.py — Handles user interaction, input validation, and program flow.
- YoutubeDL.py — Wraps the yt-dlp functionality to download media.
- database_handler.py — Manages metadata storage with support for SQLite, MySQL, and PostgreSQL.
The program uses yt-dlp to fetch the best quality media and stores it under data/. Metadata is saved depending on user choice and configured database.
Contributions to this project are welcome! If you would like to contribute, please open an issue to discuss potential changes or submit a pull request. For more details please visit the contributing page.
This project is licensed under the MIT License. You are free to use, modify, and distribute this code as permitted by the license.