A sophisticated and user-friendly automation that downloads audio from YouTube videos, transcribes the content into text, detects the language of the transcribed text, and saves the transcription to a text file. Save time, effort, and resources by harnessing cutting-edge technology to streamline the transcription process.
This script is designed to facilitate the transcription of YouTube videos into text format. It eliminates the need for time-consuming manual transcription by automating the process through a series of well-defined steps. The user-friendly interface allows users to input a YouTube video URL, which is then processed to extract the audio, convert it into text, and save the transcription as a text file. This efficient and convenient solution is ideal for those who require quick and accurate transcriptions for various purposes, such as research, content creation, or accessibility.
pytube
library to effectively filter and download the audio stream from the specified YouTube video.whisper
library, a powerful speech-to-text tool, is employed to accurately transcribe the downloaded audio into text.pip
to install required librariespytube
: A lightweight Python library that enables the downloading of YouTube videos and the extraction of audio streams.
whisper
: An advanced speech-to-text library that facilitates accurate and efficient transcription of audio files.
langdetect
: A language detection library ported from Google's language-detection.
Install the required libraries:
pip install pytube
pip install git+https://github.com/openai/whisper.git
pip install langdetect
Run the script:
python youtube_audio_to_text.py
When prompted, enter the YouTube video URL you wish to transcribe:
Enter the YouTube video URL: https://www.youtube.com/watch?v=XXXXXXXXXXX
The script will download the audio, transcribe it, detect language, and save the transcription to a text file called output_{language}.txt
.
Access the transcription by opening the output_{language}.txt
file located in the same directory as the script.
pytube
library is used to create a YouTube
object and filter the audio stream.YoutubeAudios
folder.whisper
library loads a base model and transcribes the downloaded audio into text.langdetect
library detects the language of the transcribed text.output_{language}.txt
with the language code as part of the filename and opened for the user to view.Contributions from users are highly valued and appreciated. There are two main ways to contribute to this project: through pull requests and issues.
main
branch.main
branch with a clear and concise description of the changes.🎓🌟 Feel free to contribute, share, and spread the love 💖💬🌍