Skip to content

ngxvu/YoutubeCaptionDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

YouTube Caption Downloader YouTube Caption Downloader API

A simple Flask API to download and summarize YouTube video captions as plain text.

Features

  • Download YouTube captions (subtitles) as .txt via API.
  • Supports multiple languages.
  • Summarize any text using a state-of-the-art transformer model.

Installation

  1. Clone this repository.

  2. Install dependencies (Python 3.7+):

    pip3 install flask youtube-transcript-api

Note: If you have multiple Python versions, use pip3 and python3 for Python 3.7+.

Usage

1. Run the application:

python app.py

2. Get Captions:

The API will return a JSON with the video ID and captions.

Send a POST request to /api/get-caption with a JSON body:

{
  "link": "https://www.youtube.com/watch?v=YOUR_VIDEO_ID",
  "languages": ["en"]
}
  • link: YouTube video URL or ID (required)
  • languages: List of language codes (optional, default: ["vi", "en"])

3. Summarize Text

The API will return a summary and token information.

Send a POST request to /api/summarize with a JSON body:

{
"text": "Your text to summarize here"
}

4. Example using curl

Get Captions:

curl -X POST http://localhost:5000/api/get-caption \
     -H "Content-Type: application/json" \
     -d '{"link": "https://www.youtube.com/watch?v=YOUR_VIDEO_ID"}'

Summarize Text:

curl -X POST http://localhost:5000/api/summarize \
     -H "Content-Type: application/json" \
     -d '{"text": "Paste your text here"}'

๐Ÿ“š Source & Credits

Model: facebook/bart-large-cnn youtube-transcript-api License: MIT

About

A simple Flask API to download and summarize YouTube video captions as plain text.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages