A powerful Python library for extracting transcripts from TED talks. Supports single/batch processing, multiple output formats (JSON/CSV/TXT), CLI interface, and comprehensive error handling. Perfect for NLP research and educational purposes.
1
stars
1
commits
Python
primary language
Sep 22, 2025
updated
A powerful Python library for extracting transcripts from TED talks. Extract transcripts from individual talks or process multiple talks in batch with support for various output formats.
Note: This project is adapted from corralm/ted-scraper and updated to work with the current TED website structure.
git clone https://github.com/Xintong120/ted-transcript-extractor.git
cd ted-transcript-extractor
pip install -r requirements.txt
pip install ted-transcript-extractor
from ted_extractor import TEDTranscriptExtractor
# Initialize extractor
extractor = TEDTranscriptExtractor()
# Extract transcript from a single TED talk
url = "https://www.ted.com/talks/brene_brown_the_power_of_vulnerability"
talk = extractor.extract_single(url)
if talk.success:
print(f"Title: {talk.title}")
print(f"Speaker: {talk.speaker}")
print(f"Transcript: {talk.transcript[:200]}...")
else:
print(f"Failed: {talk.error_message}")
# Extract multiple talks
urls = [
"https://www.ted.com/talks/brene_brown_the_power_of_vulnerability",
"https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action",
"https://www.ted.com/talks/amy_cuddy_your_body_language_may_shape_who_you_are"
]
talks = extractor.extract_batch(urls)
# Save results
extractor.save_results(talks, "results.json", "json")
extractor.save_results(talks, "results.csv", "csv")
# Extract single talk
python -m ted_extractor.cli --url "https://www.ted.com/talks/..." --output results.json
# Batch extract from file
python -m ted_extractor.cli --file urls.txt --output results.csv --format csv
# With custom settings
python -m ted_extractor.cli --url "..." --delay 3 --timeout 60 --verbose
For a user-friendly interactive experience, use the interactive extractor:
# Run interactive extractor
python examples/interactive_extractor.py
Features:
Main class for extracting TED transcripts.
TEDTranscriptExtractor(
delay_between_requests=2.0, # Seconds between requests
timeout=30, # Request timeout
max_retries=3, # Maximum retry attempts
user_agent=None # Custom user agent
)
extract_single(url: str) -> TEDTalk: Extract transcript from single URLextract_batch(urls: List[str], progress_callback=None) -> List[TEDTalk]: Extract from multiple URLssave_results(talks: List[TEDTalk], output_file: str, format: str) -> str: Save results to fileData model representing a TED talk with metadata and transcript.
url: TED talk URLtitle: Talk titlespeaker: Speaker namedescription: Talk descriptionduration: Duration in secondsviews: View counttranscript: Full transcript texttranscript_segments: List of transcript segments with timingsuccess: Whether extraction was successfulerror_message: Error message if extraction failedget_clean_transcript() -> str: Get cleaned transcript textget_word_count() -> int: Get word countget_reading_time_minutes(wpm=200) -> float: Estimate reading timeto_dict() -> dict: Convert to dictionary for serializationSee the examples/ directory for comprehensive usage examples:
basic_usage.py: Basic extraction and processingadvanced_usage.py: Advanced features and configurationsinteractive_extractor.py: Interactive command-line interface for easy extractionextractor = TEDTranscriptExtractor(
delay_between_requests=1.0, # Faster requests
timeout=60, # Longer timeout
max_retries=5, # More retries
user_agent="MyApp/1.0" # Custom user agent
)
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
{
"url": "https://www.ted.com/talks/...",
"title": "Talk Title",
"speaker": "Speaker Name",
"duration": 1234,
"views": 1000000,
"transcript": "Full transcript text...",
"success": true,
"extracted_at": "2024-01-01T12:00:00"
}
Tabular format with columns for all metadata fields and transcript text.
Plain text format with talk metadata and full transcript.
The library includes comprehensive error handling:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)# Clone repository
git clone https://github.com/Xintong120/ted-transcript-extractor.git
cd ted-transcript-extractor
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
# Run examples
python examples/basic_usage.py
# Run interactive extractor
python examples/interactive_extractor.py
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and research purposes. Please respect TED's terms of service and use responsibly. The authors are not affiliated with TED.
If you encounter any issues or have questions:
1 commits
Python
100.0%
A powerful Python library for extracting transcripts from TED talks. Supports single/batch processing, multiple output formats (JSON/CSV/TXT), CLI interface, and comprehensive error handling. Perfect for NLP research and educational purposes.
1
stars
1
commits
Python
primary language
Sep 22, 2025
updated
A powerful Python library for extracting transcripts from TED talks. Extract transcripts from individual talks or process multiple talks in batch with support for various output formats.
Note: This project is adapted from corralm/ted-scraper and updated to work with the current TED website structure.
git clone https://github.com/Xintong120/ted-transcript-extractor.git
cd ted-transcript-extractor
pip install -r requirements.txt
pip install ted-transcript-extractor
from ted_extractor import TEDTranscriptExtractor
# Initialize extractor
extractor = TEDTranscriptExtractor()
# Extract transcript from a single TED talk
url = "https://www.ted.com/talks/brene_brown_the_power_of_vulnerability"
talk = extractor.extract_single(url)
if talk.success:
print(f"Title: {talk.title}")
print(f"Speaker: {talk.speaker}")
print(f"Transcript: {talk.transcript[:200]}...")
else:
print(f"Failed: {talk.error_message}")
# Extract multiple talks
urls = [
"https://www.ted.com/talks/brene_brown_the_power_of_vulnerability",
"https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action",
"https://www.ted.com/talks/amy_cuddy_your_body_language_may_shape_who_you_are"
]
talks = extractor.extract_batch(urls)
# Save results
extractor.save_results(talks, "results.json", "json")
extractor.save_results(talks, "results.csv", "csv")
# Extract single talk
python -m ted_extractor.cli --url "https://www.ted.com/talks/..." --output results.json
# Batch extract from file
python -m ted_extractor.cli --file urls.txt --output results.csv --format csv
# With custom settings
python -m ted_extractor.cli --url "..." --delay 3 --timeout 60 --verbose
For a user-friendly interactive experience, use the interactive extractor:
# Run interactive extractor
python examples/interactive_extractor.py
Features:
Main class for extracting TED transcripts.
TEDTranscriptExtractor(
delay_between_requests=2.0, # Seconds between requests
timeout=30, # Request timeout
max_retries=3, # Maximum retry attempts
user_agent=None # Custom user agent
)
extract_single(url: str) -> TEDTalk: Extract transcript from single URLextract_batch(urls: List[str], progress_callback=None) -> List[TEDTalk]: Extract from multiple URLssave_results(talks: List[TEDTalk], output_file: str, format: str) -> str: Save results to fileData model representing a TED talk with metadata and transcript.
url: TED talk URLtitle: Talk titlespeaker: Speaker namedescription: Talk descriptionduration: Duration in secondsviews: View counttranscript: Full transcript texttranscript_segments: List of transcript segments with timingsuccess: Whether extraction was successfulerror_message: Error message if extraction failedget_clean_transcript() -> str: Get cleaned transcript textget_word_count() -> int: Get word countget_reading_time_minutes(wpm=200) -> float: Estimate reading timeto_dict() -> dict: Convert to dictionary for serializationSee the examples/ directory for comprehensive usage examples:
basic_usage.py: Basic extraction and processingadvanced_usage.py: Advanced features and configurationsinteractive_extractor.py: Interactive command-line interface for easy extractionextractor = TEDTranscriptExtractor(
delay_between_requests=1.0, # Faster requests
timeout=60, # Longer timeout
max_retries=5, # More retries
user_agent="MyApp/1.0" # Custom user agent
)
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
{
"url": "https://www.ted.com/talks/...",
"title": "Talk Title",
"speaker": "Speaker Name",
"duration": 1234,
"views": 1000000,
"transcript": "Full transcript text...",
"success": true,
"extracted_at": "2024-01-01T12:00:00"
}
Tabular format with columns for all metadata fields and transcript text.
Plain text format with talk metadata and full transcript.
The library includes comprehensive error handling:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)# Clone repository
git clone https://github.com/Xintong120/ted-transcript-extractor.git
cd ted-transcript-extractor
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
# Run examples
python examples/basic_usage.py
# Run interactive extractor
python examples/interactive_extractor.py
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and research purposes. Please respect TED's terms of service and use responsibly. The authors are not affiliated with TED.
If you encounter any issues or have questions:
1 commits
Python
100.0%