Skip to main content

CLI tool to search youtube captions

Project description

https://travis-ci.com/alexkohler/ytgrep.svg?branch=master

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

Requirements

  • Requires python >= 3.5

Installation

pip install ytgrep

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

Purpose

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:

image0

Usage

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

Flags

  • -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' https://www.youtube.com/watch?v=OIYOshsEqmQ

Search with regular expression

ytgrep -e 'banana|potassium' https://www.youtube.com/watch?v=OIYOshsEqmQ

Search multiple urls

ytgrep 'banana' https://www.youtube.com/watch?v=LH5ay10RTGY https://www.youtube.com/watch?v=zFQWVN4xip0

Development

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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ytgrep-0.5.0.tar.gz.

File metadata

  • Download URL: ytgrep-0.5.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.1

File hashes

Hashes for ytgrep-0.5.0.tar.gz
Algorithm Hash digest
SHA256 df02bd644b8251d3f7836ee5b500740bb7f5234fd9c7206bb63d6619f7227af6
MD5 f8c67ac986b4cc87010d0c77cfaa7416
BLAKE2b-256 fdbb9b85a6b29c1993a91257446c4d1a7a45f80db519a7f98358dfd4f180a0d7

See more details on using hashes here.

File details

Details for the file ytgrep-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: ytgrep-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.1

File hashes

Hashes for ytgrep-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 179a082abaedb0daf2982e595feac072dd2041bcc28737e462e045044f39ffdd
MD5 a4c28bbadc821f725f1902bc96d32673
BLAKE2b-256 64f0ed82121b0626973407f8b1265977a2bbfa84eb3ae3a95da66144a8efa86a

See more details on using hashes here.

Supported by

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