Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mkly/youtube-closed-captions

Python library for downloading closed captions(subtitles) from Youtube
https://github.com/mkly/youtube-closed-captions

Last synced: about 2 months ago
JSON representation

Python library for downloading closed captions(subtitles) from Youtube

Awesome Lists containing this project

README

        

Youtube Closed Captions
-----------------------

Downloads the closed captions(subtitles) from Youtube videos
============================================================

.. image:: https://circleci.com/gh/mkly/youtube-closed-captions.svg?style=svg
:target: https://circleci.com/gh/mkly/youtube-closed-captions

Requirements
~~~~~~~~~~~~

* Currently requires python >= 3.5

To Use
~~~~~~

.. code:: python

from ytcc.download import Download

video_id = 'jNQXAC9IVRw'
download = Download()
# Language is optional and default to "en"
# YouTube uses "en","fr" not "en-US", "fr-FR"
captions = download.get_captions(video_id, 'en')

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