- Download YouTube captions (subtitles) as
.txt
via API. - Supports multiple languages.
- Summarize any text using a state-of-the-art transformer model.
-
Clone this repository.
-
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+.
python app.py
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"])
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"
}
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"}'