Skip to main content

CLI tool to search youtube captions

Project description

ytgrep is a CLI tool to search Youtube closed captions with a grep-like interface.


  • Requires python >= 3.5


pip install ytgrep

Note: you must have pip’s bin folder on your PATH.


ytgrep is particularly useful whilst looking for particular topic or keywords mentioned in a video.

For example, searching for the word ‘topoloigcal sort’ in MIT’s Open Courseware Lecture on DFS and topological sort:



usage: [-h] [-e] [-v] [-links] pattern urls [urls ...]


  • -e <PATTERN> - specify a regular expression to match
  • -v - verbose, print debug information
  • -links - include the time shortcut link with each match (see example below)

More examples

Include timestamped links (e.g. <youtube URL>/&t=196s) to jump directly to part in video where keyword was mentioned.

$ ytgrep -links 'potassium'

Search with regular expression

ytgrep -e 'banana|potassium'

Search multiple urls

ytgrep 'banana'


Run Tests

Note: Functional tests do download directly from Youtube

## All tests
python -m unittest discover

## Unit tests
python -m unittest discover test/unit

## Functional tests
python -m unittest discover test/functional

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

ytgrep-0.5.0.tar.gz (7.6 kB view hashes)

Uploaded source

Built Distribution

ytgrep-0.5.0-py3-none-any.whl (10.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page