youtube-transcript

Crates.ioyoutube-transcript
lib.rsyoutube-transcript
version0.3.2
sourcesrc
created_at2023-04-14 18:43:27.90319
updated_at2023-04-16 19:13:23.690696
descriptionTranscripts Youtube
homepage
repositoryhttps://github.com/akhildevelops/summarizer/tree/main/youtube-transcript
max_upload_size
id839363
size76,147
Akhil (akhildevelops)

documentation

README

Youtube Transcript

Retrieve transcript of any youtube video.

Documentation

Install

cargo install youtube-transcript

Usage:

as Commandline

renders transcript in text format / json format. By default it's text.

youtube-transcript https://www.youtube.com/watch?v=RcYjXbSJBN8

start at: 639ms for duration 2s
welcome back
==========


start at: 2s for duration 4s
here we go again great to see you and
==========
...
...

For json

youtube-transcript --format json https://www.youtube.com/watch?v=RcYjXbSJBN8

{
  "transcripts": [
    {
      "text": "Hey, how's it going Dave 2d here?",
      "start": {
        "secs": 0,
        "nanos": 0
      },
      "duration": {
        "secs": 1,
        "nanos": 539999962
      }
    },
    {
      "text": "This is a Microsoft Surface go and when they first announced it I was interested in it",
      "start": {
        "secs": 1,
        "nanos": 539999962
      },
      "duration": {
        "secs": 4,
        "nanos": 159999847
      }
    }
    ...
    ...
  ]
}
...
...

as Library

youtube-transcript is an async library and below is the example to use in an applicatio:

let link:&str="https://www.youtube.com/watch?v=RcYjXbSJBN8";

# Create a youtube instance from builder.
let youtube_loader:Youtube = YoutubeBuilder::default().build();

# Get the transcript by loading youtube url.
let transcript:Transcript=youtube_loader.transcript(link).await?;

Other tools

Inspired from: youtube-transcript-api

Commit count: 0

cargo fmt