Skip to main content

clipscribe

Extract transcripts from YouTube, TikTok, and Instagram URLs.

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

This is a 0.1.0 library. Site extractors break when platforms change pages. Keep yt-dlp updated if you use TikTok or Instagram.

Source: github.com/darkknight127/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 often needs cookies when the site blocks anonymous requests:

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. Use one TranscriptExtractor per thread.
  • register() is per instance, not global.
  • 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.0.tar.gz (17.9 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.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clipscribe-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 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.0.tar.gz
Algorithm Hash digest
SHA256 e5e49beef91d6981e9508b283cf72ecf1c73f259477b2a45f9831778e3e4d0ac
MD5 59c43e5950284ad9fa18d4e41ee6cd0b
BLAKE2b-256 dc84971d0332cf3c7ac258b4e87eb866e8494668bb27f4ced2a380e4ec8bc6fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clipscribe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9607b949d71991886e429f6b34fd5ae39d614dbc3802ab9bbd879388860396ea
MD5 97f4ed8fef43407269d155eeb2cce104
BLAKE2b-256 a86550c6f8e7a944e73e0865593cf7d3f66d6fd263358f404ab1d2fa8485ff0f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

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