Retrieve transcript of any youtube video.
cargo install youtube-transcript
renders transcript in text format / json format. By default it's text.
``` bash youtube-transcript https://www.youtube.com/watch?v=RcYjXbSJBN8
start at: 639ms for duration 2s
start at: 2s for duration 4s
... ... ```
For json ``` bash 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 } } ... ... ] } ... ... ```
youtube-transcript is an async library and below is the example to use in an applicatio: ``` rust let link:&str="https://www.youtube.com/watch?v=RcYjXbSJBN8";
let youtube_loader:Youtube = YoutubeBuilder::default().build();
let transcript:Transcript=youtube_loader.transcript(link).await?; ```
Inspired from: youtube-transcript-api