Skip to content

zshmeta/yt-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt-script

yt-script is a command-line tool for fetching and formatting YouTube video transcripts. It supports multiple languages, various output formats, and optional translation of transcripts.

Table of Contents

Features

  • Fetches transcripts for YouTube videos.
  • Supports multiple languages.
  • Outputs transcripts in various formats (pretty, JSON, plain text).
  • Option to translate transcripts to different languages.
  • Lists available languages for transcripts.

Installation

Global Installation

To install yt-script globally, run:

npm install -g .

Local Installation

To install yt-script locally for development or testing, run:

npm install .

Usage

Fetching Transcripts

The basic command to fetch a transcript is:

yt-script <video_id_or_url>

Options

  • --list-transcripts: List available languages for the given videos.
  • --languages <languages...>: List of languages in descending priority (default: ['en']).
  • --format <format>: Output format (pretty, json, text, default: pretty).
  • --translate <language>: Language to translate the transcript to.

Examples

  1. Fetch transcript in default format (pretty):

    yt-script https://www.youtube.com/watch?v=abcd1234EFG
  2. Fetch transcript in JSON format:

    yt-script https://www.youtube.com/watch?v=abcd1234EFG --format json
  3. Fetch transcript and translate to French:

    yt-script https://www.youtube.com/watch?v=abcd1234EFG --translate fr
  4. List available languages for a video:

    yt-script https://www.youtube.com/watch?v=abcd1234EFG --list-transcripts
  5. Fetch transcript with multiple languages prioritized:

    yt-script https://www.youtube.com/watch?v=abcd1234EFG --languages en fr de

Development

For development, clone the repository and install the dependencies:

git clone https://github.com/zshmeta/ytScript.git
cd ytScript
npm install

Run the script locally:

node index.js <video_id_or_url>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published