A simple library that allows you to transcribe any single person YouTube video into a text file using OpenAI's Whisper module.
- Clone this library and cd into the ytscribe folder:
git clone https://github.com/vamsiuppala/ytscribe.git
cd ytscribe
- Install dependencies
pip install -r requirements.txt
You can also install the library from pip
pip install ytscribe
- This package has one main module that takes YouTube link and simply transcribes it.
- Pick a video that only has a single speaker since Whisper doesn't differentiate between multiple speakers
- As an example, let's pick one of MKBHD's videos from AutoFocus - https://www.youtube.com/watch?v=CRhjL9X2yKA
video_url = "https://www.youtube.com/watch?v=CRhjL9X2yKA"
directory = "files"
from ytscribe import transcribe
# transcribe
transcribe.download_video_and_transcribe(video_url, directory, output_filename = 'title', whisper_model = 'base')The above bit should create a folder called files and add the transcribed YouTube video as a txt file.
On my 16GB M1 Pro Macbook Pro, a 20 minute video took around 2 minutes to get downloaded and transcribed
If you run into ssl certification troubles, this command helped me
import ssl
ssl._create_default_https_context = ssl._create_unverified_context