MCPcopy
hub / github.com/jdepoix/youtube-transcript-api / FetchedTranscript

Class FetchedTranscript

youtube_transcript_api/_transcripts.py:50–72  ·  view source on GitHub ↗

Represents a fetched transcript. This object is iterable, which allows you to iterate over the transcript snippets.

Source from the content-addressed store, hash-verified

48
49@dataclass
50class FetchedTranscript:
51 """
52 Represents a fetched transcript. This object is iterable, which allows you to
53 iterate over the transcript snippets.
54 """
55
56 snippets: List[FetchedTranscriptSnippet]
57 video_id: str
58 language: str
59 language_code: str
60 is_generated: bool
61
62 def __iter__(self) -> Iterator[FetchedTranscriptSnippet]:
63 return iter(self.snippets)
64
65 def __getitem__(self, index) -> FetchedTranscriptSnippet:
66 return self.snippets[index]
67
68 def __len__(self) -> int:
69 return len(self.snippets)
70
71 def to_raw_data(self) -> List[Dict]:
72 return [asdict(snippet) for snippet in self]
73
74
75@dataclass

Callers 4

setUpMethod · 0.90
setUpMethod · 0.90
fetchMethod · 0.85
setUpMethod · 0.85

Calls

no outgoing calls

Tested by 3

setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…