Skip to content
/ dlsub Public

Download and structure in text the subtitles of videos on YouTube.

License

Notifications You must be signed in to change notification settings

scovl/dlsub

Repository files navigation

dlsub

GitPod Ready-to-Code

dlsub is a command line tool for downloading transcripts of YouTube videos. It uses the YouTube Transcript API to download the transcript and save it to a file. The downloaded transcript can be optionally formatted to remove unwanted characters like numbers and punctuation.

Usage

To download a transcript for a YouTube video, use the following command:

python dlsub.py --download <video_id> -o output.txt -l en

Replace <video_id> with the ID of the YouTube video you want to download subtitles from. The video ID is the part of the URL after watch?v=. By default, the transcript will not be formatted. To format the transcript, use the -f or --format option:

python dlsub.py --download <video_id> -o output.txt -l en -f 

Configure the file config_ai.yaml with your chatsonic api_key. Eg:

api_key: add-your-api-key

To acquire your api_key, access the following video for information How to Get Chatsonic API Key. Use with writesonic/chatsonic to generate a summary of the video:

python dlsub.py --download <video_id> -o output.txt -l en -ai

Use -s --sumarize to generate a summary of the video:

python dlsub.py --download <video_id> -o output.txt -l en -ai -s

Installation

  1. Clone this repository.
  2. Create a Python virtual environment and activate it.
  3. Install the required packages with pip install -r requirements.txt.
  4. Run python dlsub.py --download <video_id> -o output.txt -f to download transcripts for YouTube videos.

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Read our CONTRIBUTING.MD file.

License

MIT

About

Download and structure in text the subtitles of videos on YouTube.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages