Skip to main content

A simple wrapper for youtube-transcript-api to get YouTube video transcripts with ease.

Project description

Mr. Transcript

DOI PyPI Downloads PyPI - License PyPI - Version

A convenient wrapper for the youtube-transcript-api library designed to retrieve YouTube video transcripts quickly and reliably.

Key Features

  • Automatic URL Handling: Supports various YouTube link formats, including youtube.com, youtu.be, shorts, and embed.
  • Intelligent Search: The package first looks for manually created transcripts; if they are unavailable, it automatically switches to YouTube's auto-generated ones.
  • Timecodes: Option to add timestamps to each text block.
  • Language List: Quickly retrieve a dictionary of all available languages for a specific video.
  • Type Safety: Full support for type annotations for better development experience.

Installation

Install the package via pip:

pip install mr-transcript

Or using uv:

uv add mr-transcript

Quick Start

from mr_transcript import get_transcript, get_languages

url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# 1. Check available languages
languages = get_languages(url)
print(f"Available languages: {languages}")

# 2. Retrieve transcript text (e.g., in English)
if "en" in languages:
    text = get_transcript(url, language="en", timecodes=True)
    print(text[:500])  # Prints the first 500 characters

AI Agent Skill

This repository includes a specialized skill for AI agents (like Gemini CLI). It helps the agent provide expert assistance with Python coding, URL parsing, and integrating this library into your projects.

To install the skill, run:

npx skills add BogdanovychA/mr-transcript --skill mr-transcript

Function Descriptions

get_transcript(video_id, language, timecodes=False)

Retrieves the full transcript text.

  • video_id: Video ID or a full link.
  • language: Language code (e.g., 'en', 'uk').
  • timecodes: If True, adds the start time to each text block.

get_languages(video_id)

Returns a dictionary of all available languages for the video.

  • Format: {"language_code": "language_name"} (e.g., {"en": "English"}).

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mr_transcript-0.1.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mr_transcript-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file mr_transcript-0.1.2.tar.gz.

File metadata

  • Download URL: mr_transcript-0.1.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mr_transcript-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e4142b991f2a93da47a468bbfde55007455b4de7ad1db8cceb9af7f09a5405c5
MD5 a6876c90ecd41bb2af0bbe36db08becd
BLAKE2b-256 e4d529f7598e43f0e42ef8dc2fc3e7c06a6836f5fe0d6656630d8de56a7f0e50

See more details on using hashes here.

File details

Details for the file mr_transcript-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mr_transcript-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mr_transcript-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aae7be36f0ea38d955839fd6454a5fceef9ac70373b8449c838f72f1c2759314
MD5 6eb292cd4ab1613ec2dd6b24e2fad6ad
BLAKE2b-256 77475067ed4afbeb362784120cb3114ce7f1349037c10557774f57afefd89650

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page