Coder Social home page Coder Social logo

youtube-transcript-toolkit's Introduction

ytt - Youtube Transcript Toolkit

YouTube automatic captioning is a very neat feature as it a provides summarized and static ressources for exploiting the content of videos by generating precisely timed transcripts. For instance, with audio book or audio theatre videos, it can help extracting the script of fictional works without having to run (and pay for) a state-of-the-art STT software.

Captions for a given YouTube video can be downloaded with youtube-dl as WebVTT files:

youtube-dl --write-auto-sub --sub-lang fr --skip-download [URL]

Yet, there is a gap between the raw VTT file and the actual transcript: sentences are often duplicated, words can be duplicated too, timecodes are fuzzy around words, etc. So the first thing this module does is parsing those VTT files and generating clean transcripts. Then, it provides tools for exploiting those transcripts in fun ways: creating a montage of a given word or re-creating a given script from video extracts:

Word montage Script re-creation
Source : Monsieur Phi Source : Thinkerview

Getting Started

Prerequisites

You must have a working installation of Python, youtube-dl (any fork should work) and FFmpeg. Better if they are in PATH.

Installation

Simply clone this repository:

git clone https://github.com/ychalier/ytt.git

And install the requirements (actually, only tqdm):

cd ytt
pip install -r requirements.txt

Usage

python ytt.py [-h] -i INPUT [-ft FILTER] [-fd FIND] [-o OUTPUT] [-x EXTRACT]
              [-yd YOUTUBE_DL] [-fm FFMPEG] [-td TEMPDIR] [-lg LANG]
              [-pp PADDING_PREV] [-pn PADDING_NEXT] [-la LOOKAHEAD] [-ff]

Use -h or --help to get details. For example, here's how to get the first word montage:

python ytt.py -i https://www.youtube.com/watch?v=GuTgfnkILGs -ft boule -x . -pp 1 -pn 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.