Skip to main content

youtube-to-text

Documentation / extractor/url-to-content/youtube-to-text

Extract​

convertYoutubeToText()​

function convertYoutubeToText(videoUrl: string, options?: object): object;

Defined in: extractor/url-to-content/youtube-to-text.js:19

Fetch youtube.com video's webpage HTML for embedded transcript. If blocked, use scraper of alternative sites providing transcripts.

Parameters​

ParameterTypeDescription

videoUrl

string

options?

{ addTimestamps: boolean; timeout: boolean; }

options.addTimestamps?

boolean

default=true - true to return timestamps, default true

options.timeout?

boolean

default=5 - http request timeout

Returns​

object

where content is the full text of the transcript, timestamps is a string of comma-separated [characterIndex, timeSeconds] pairs, and word_count is the number of words in the transcript.

NameTypeDefined in

content

string

extractor/url-to-content/youtube-to-text.js:12

timestamps

string

extractor/url-to-content/youtube-to-text.js:12

word_count

number

extractor/url-to-content/youtube-to-text.js:12

Author​

ai-research-agent (2024)

Other​

fetchViaYoutubeToTranscriptCom()​

function fetchViaYoutubeToTranscriptCom(videoId: any, options: object): any;

Defined in: extractor/url-to-content/youtube-to-text.js:153

Fetch-based scraper of youtubetotranscript.com

Parameters​

ParameterType

videoId

any

options

{ }

Returns​

any

content, timestamps - where content is the full text of the transcript, and timestamps is an array of [characterIndex, timeSeconds]