This project is a Streamlit application that allows users to search for videos on YouTube, download them, convert them into audio files, trim the audio, and combine multiple audio files into a single output. The app leverages yt_dlp for video and audio downloading and ffmpeg for audio processing.
-
Video Download:
- Search for videos on YouTube using a query.
- Download a specified number of videos.
-
Audio Conversion:
- Convert downloaded videos into MP3 audio files.
-
Audio Trimming:
- Trim a specified number of seconds from the beginning of each audio file.
-
Audio Merging:
- Combine trimmed audio files into a single MP3 file.
-
Interactive UI:
- User-friendly interface built with Streamlit for seamless interaction.
-
User inputs:
- Search Term: The query for the videos (e.g., "machine learning course").
- Number of Videos: The number of videos to download.
- Trim Audio: The number of seconds to trim from the beginning of each audio file.
-
The application:
- Searches and downloads videos using
yt_dlp. - Converts the videos to MP3 audio files.
- Trims the specified seconds from the beginning of each audio file.
- Combines all trimmed audio files into a single output file.
- Searches and downloads videos using
- Python 3.7 or later
yt_dlpstreamlitffmpeg
├── app.py
├── requirements.txt
├── README.md
- Launch the Streamlit app.
- Enter the search term, number of videos to download, and the trim duration.
- Click on "Download and Convert".
- The application will:
- Download the specified videos.
- Convert them into audio files.
- Trim the audio as specified.
- Merge the audio files into a single MP3 file.
The downloaded videos and audio files will be saved in the following directories:
- Videos:
~/Desktop/ML-course-downloads - Audio Files:
~/Desktop/ML-course-audiofiles
- Update the
ffmpeg_pathvariable with the correct path to theffmpeg.exefile. - Ensure
ffmpegis installed and added to your system's PATH.
- Videos are saved in
~/Desktop/ML-course-downloads. - Audio files are saved in
~/Desktop/ML-course-audiofiles.
- The application relies on
yt_dlpfor video downloads and may be subject to YouTube's rate limits. - The provided
ffmpegpath must be correctly configured for audio processing.
- Add support for downloading playlists.
- Allow users to specify audio quality and format.
- Add progress tracking for downloads and conversions.
This project was done in collaboration with https://github.com/arnavtiet.
- yt_dlp for simplifying YouTube video and audio downloads.
- Streamlit for creating a seamless and interactive user interface.