Extract transcripts (subtitles) from YouTube videos in seconds
Supports timestamps • Saves to transcript.txt • Simple CLI
- 📜 Extract subtitles from YouTube videos
- ⏱️ Optional timestamps
- 📄 Saves the transcript to a
.txtfile - ⚡ Fast and easy to use
- 🐍 Written in Python
Clone the repository:
git clone https://github.com/flameastro/transcript-youtube-video.git
cd transcript-youtube-videoInstall the dependencies:
pip install playwright
playwright installRun the project:
python main.pyIf that doesn't work:
python3 main.pyAfter running the program:
Paste the YouTube URL:
>>> https://youtu.be/xxxxxxxx
Include timestamps? (y/n):
>>> y
The program creates:
transcript.txt
Example output:
00:00 Welcome back everyone!
00:07 Today we're going to...
00:15 Let's get started...
The generated file may be empty if:
- The video has no subtitles.
- The creator disabled captions.
- The video contains very little speech.
- The video is extremely long.
- Python 3.10+
- Git
- Playwright
Contributions are welcome!
If you have an idea for an improvement, feel free to open an Issue or submit a Pull Request.
If this project helped you, consider giving it a ⭐ on GitHub.
It helps more people discover the project.
This project is licensed under the MIT License.


