Skip to main content

clipscribe

PyPI

Extract transcripts from YouTube, TikTok, and Instagram URLs.

YouTube uses youtube-transcript-api. TikTok and Instagram use yt-dlp + faster-whisper.

PyPI: pypi.org/project/clipscribe

Install

Pick the platforms you need, or install all of them:

pip install "clipscribe[youtube]"
pip install "clipscribe[tiktok]"
pip install "clipscribe[instagram]"
pip install "clipscribe[youtube,tiktok]"
pip install "clipscribe[all]"

TikTok and Instagram download Whisper models on first use. ffmpeg comes from imageio-ffmpeg; no system install is required.

From this repo:

pip install -e ".[all,dev]"

If TikTok/Instagram downloads start failing, upgrade the extractor stack:

pip install -U yt-dlp imageio-ffmpeg

Usage

from clipscribe import TranscriptExtractor

api = TranscriptExtractor()
result = api.extract("https://www.youtube.com/watch?v=VIDEO_ID")

print(result.full_text)
print(result.to_dict())

Batch (failed URLs are skipped and logged):

results = api.extract_many([url1, url2, url3])

Save files under output/ relative to the current working directory (json by default). Choose from json, txt, srt:

result = api.extract(url, save=True)

api = TranscriptExtractor(allowed_outputs=["json", "srt"])
result = api.extract(url, save=True)

result = api.extract(url, save=True, allowed_outputs=["srt"])

Retry flaky TikTok downloads:

result = api.extract(tiktok_url, max_retries=2)

TikTok works without cookies. Pass cookies only if the site blocks the anonymous download:

api = TranscriptExtractor(tiktok_cookies_from_browser="firefox")

Or a Netscape cookies file:

api = TranscriptExtractor(tiktok_cookies="tiktok_cookies.txt")

YouTube proxy (optional):

from clipscribe import GenericProxyConfig, TranscriptExtractor

api = TranscriptExtractor(
    youtube_proxy_config=GenericProxyConfig(
        http_url="http://user:pass@host:port",
        https_url="http://user:pass@host:port",
    )
)

Instagram needs auth. Browser cookies are the most reliable. This also requires the instagram extra:

api = TranscriptExtractor(instagram_cookies_from_browser="firefox")
result = api.extract("https://www.instagram.com/reel/REEL_ID/")

Or a Netscape cookies file:

api = TranscriptExtractor(instagram_cookies="instagram_cookies.txt")

TikTok and Instagram videos longer than 15 minutes are rejected unless you raise or disable the cap:

api = TranscriptExtractor(max_duration_s=None)

Notes

  • First TikTok/Instagram run may download a Whisper model and ffmpeg. That needs disk and network.
  • Default Whisper model is tiny (speed over accuracy).
  • YouTubeTranscriptApi is not thread-safe. Concurrent calls on one instance are serialized with a lock.
  • register() is per instance, not global.
  • Failures raise ClipscribeError subclasses (UnsupportedURLError, TranscriptNotFoundError, AuthenticationRequiredError, ...). extract_many() returns a BatchResult with .results and .errors.
  • CLI: clipscribe URL [--save] [--format json,txt,srt] or python -m clipscribe URL.
  • Async: await api.extract_async(url) and await api.extract_many_async(urls).
  • You are responsible for complying with YouTube, TikTok, and Instagram terms of use.

Download files

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

Source Distribution

clipscribe-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

clipscribe-0.1.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file clipscribe-0.1.1.tar.gz.

File metadata

  • Download URL: clipscribe-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for clipscribe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8c7a98dd4dacfcc8fed44c260cee6abb764d0ba524c3fe75d1a47c14a7fc37db
MD5 ab11ea55af6049607107777b4096aa66
BLAKE2b-256 357a3f2cc173e0b55c0369fcd8ced34d6222b5c078091bd10277ea76a32bb4cf

See more details on using hashes here.

File details

Details for the file clipscribe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clipscribe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for clipscribe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac845e39da15d01dd2503bf9a5c4db0811c17345434deca09118d18698722f32
MD5 e370184d981047a4dfacdd0653e8dcea
BLAKE2b-256 502b613e613857349f88493eb4a352997fd43a41456d8b92286cf73456bb96b2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page