Metadata-Version: 2.1
Name: ytgrep
Version: 0.4.6
Summary: CLI tool to search youtube captions
Home-page: UNKNOWN
Author: Alex Kohler
Author-email: alexjohnkohler@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: astroid (==2.1.0)
Requires-Dist: autopep8 (==1.4.3)
Requires-Dist: beautifulsoup4 (==4.4.1)
Requires-Dist: bleach (==3.1.0)
Requires-Dist: certifi (==2018.11.29)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: colorama (==0.4.1)
Requires-Dist: cssutils (==1.0.1)
Requires-Dist: docutils (==0.14)
Requires-Dist: enum34 (==1.1.6)
Requires-Dist: future (==0.16.0)
Requires-Dist: idna (==2.8)
Requires-Dist: isort (==4.3.4)
Requires-Dist: lazy-object-proxy (==1.3.1)
Requires-Dist: lxml (==4.3.0)
Requires-Dist: mccabe (==0.6.1)
Requires-Dist: pkginfo (==1.5.0.1)
Requires-Dist: pycaption (==1.0.1)
Requires-Dist: pycodestyle (==2.4.0)
Requires-Dist: Pygments (==2.3.1)
Requires-Dist: pylint (==2.2.2)
Requires-Dist: readme-renderer (==24.0)
Requires-Dist: requests (==2.21.0)
Requires-Dist: requests-toolbelt (==0.9.1)
Requires-Dist: six (==1.12.0)
Requires-Dist: tqdm (==4.31.0)
Requires-Dist: twine (==1.12.1)
Requires-Dist: urllib3 (==1.25.1)
Requires-Dist: vulture (==1.0)
Requires-Dist: webencodings (==0.5.1)
Requires-Dist: wrapt (==1.11.1)
Requires-Dist: youtube-dl (==2019.4.24)

ytgrep
-----------------------

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


Requirements
=============

* Requires python >= 3.5

Installation
=============

.. code:: bash

    pip install ytgrep

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 <https://www.youtube.com/watch?v=AfSk24UTFS8>`__:

|image0|

.. |image0| image:: https://asciinema.org/a/SjG0XTmIPzDfNgx2SxwhCdXwt.svg
   :target: https://asciinema.org/a/SjG0XTmIPzDfNgx2SxwhCdXwt


Usage
==============

.. code:: bash

    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 shortcut links to times where keywords were mentioned

.. code:: bash

    $ ytgrep -links 'potassium' https://www.youtube.com/watch?v=OIYOshsEqmQ

Search with regular expression

.. code:: bash

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


Search multiple urls

.. code:: bash

    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

.. code:: bash

   ## All tests
   python -m unittest discover

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

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

Related projects
==================
 * youtube-closed-captions - This project used this library as a starting point https://github.com/mkly/youtube-closed-captions
 * videogrep - get supercuts of video matching provided seach terms


