This repository contains two command-line tools to help you easily extract and save transcripts from YouTube videos and playlists. Both tools are implemented in Python and can be executed via simple batch commands. README
This repository contains two command-line tools to help you easily extract and save transcripts from YouTube videos and playlists. Both tools are implemented in Python and can be executed via simple batch commands.
The transcript
command fetches the transcript from a single YouTube video and saves it as a text file in your Downloads folder. The transcript is formatted for readability, with paragraph breaks every few sentences.
https://www.youtube.com/watch?v= **HgL_REJe4LU**
transcript <YouTube_Video_ID>
transcript fiIaqAYPzFk
- The transcript will be saved in the Downloads folder as a text file named after the video title.
- Example output file:
C:\Users\<YourUsername>\Downloads\<Video_Title>_transcript.txt
The playlist
command fetches transcripts for all videos in a specified YouTube playlist. Each transcript is saved individually in your Downloads folder, named after the corresponding video title.
playlist "<YouTube_Playlist_URL>"
playlist "https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi"
- Each transcript is saved in the Downloads folder as a text file, named after the video title.
- Example output files:
C:\Users\<YourUsername>\Downloads\<Video_Title_1>_transcript.txt
C:\Users\<YourUsername>\Downloads\<Video_Title_2>_transcript.txt
- Python 3.x installed on your system.
- Required Python libraries:
pytube
,youtube-transcript-api
.
-
Install Python Libraries:
- Run the following commands to install the necessary libraries:
pip install pytube pip install youtube-transcript-api
- Run the following commands to install the necessary libraries:
-
Batch Files Setup:
- Ensure that
transcript.bat
andplaylist.bat
are correctly set up in yourC:\Scripts\
directory.
- Ensure that
-
Environment Variables:
- Add
C:\Scripts
to your system's PATH environment variable to allow the use of these commands globally from any directory in the Command Prompt.
- Add
- URL or Video ID Issues: Make sure that the video ID or playlist URL is correctly formatted and enclosed in quotes if it contains special characters.
- PATH Configuration: Ensure that
C:\Scripts
is correctly added to the PATH environment variable, and that the batch files are located in their respective directory. 'C:\Scripts\playlist
'C:\Scripts\transcript
'
Drew Thorsen: Original script and command setup.