tubezero 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,303 @@
1
+ /**
2
+ * scraper.ts
3
+ * Scrapes user-specific YouTube feeds: History, Likes, Watch Later, and Custom Playlists.
4
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments).
5
+ */
6
+ interface VideoEntry {
7
+ title: string;
8
+ channel: string;
9
+ }
10
+ interface InnerTubeConfig {
11
+ apiKey: string | null;
12
+ clientVersion: string;
13
+ idToken: string | null;
14
+ }
15
+ interface CustomPlaylist {
16
+ url: string;
17
+ }
18
+ interface CustomPlaylistData {
19
+ id: string;
20
+ entries: VideoEntry[];
21
+ }
22
+ interface TasteData {
23
+ historyEntries: VideoEntry[];
24
+ likesEntries: VideoEntry[];
25
+ wlEntries: VideoEntry[];
26
+ dislikesEntries: VideoEntry[];
27
+ customPlaylistsData: CustomPlaylistData[];
28
+ }
29
+ /**
30
+ * Fetches the HTML of a YouTube page and extracts `ytInitialData`.
31
+ * @param url - The URL to fetch.
32
+ * @returns The parsed ytInitialData object or null.
33
+ */
34
+ declare function fetchYtInitialData(url: string): Promise<any>;
35
+ /**
36
+ * Reads SAPISID cookies from the browser environment.
37
+ * Only works if running on a youtube.com domain or in an extension with cookie access.
38
+ * @returns The SAPISID value or null.
39
+ */
40
+ declare function getSapisidFromCookie(): string | null;
41
+ /**
42
+ * Generates the SAPISIDHASH Authorization header value needed for authenticated InnerTube requests.
43
+ * @param sapisid - The SAPISID cookie value.
44
+ * @param origin - The request origin.
45
+ * @returns The generated authorization hash or null.
46
+ */
47
+ declare function getSApiSidHash(sapisid: string, origin?: string): Promise<string | null>;
48
+ /**
49
+ * Recursively scans a JSON object to extract video entries { title, channel }.
50
+ * Handles both the legacy videoRenderer and the newer lockupViewModel schemas.
51
+ * @param data - The JSON object to search.
52
+ * @returns Array of extracted video entries.
53
+ */
54
+ declare function extractVideoEntries(data: any): VideoEntry[];
55
+ /**
56
+ * Extracts InnerTube credentials and configuration parameters by parsing the YouTube home page.
57
+ * @param injectedConfig - Pre-fetched config if available (bypasses fetching).
58
+ * @returns InnerTube config parameters.
59
+ */
60
+ declare function getInnerTubeConfig(injectedConfig?: Partial<InnerTubeConfig> | null): Promise<InnerTubeConfig>;
61
+ /**
62
+ * Recursively searches for the continuation token in an InnerTube response.
63
+ * @param obj - InnerTube response subtree.
64
+ * @returns The token or null.
65
+ */
66
+ declare function findContinuationToken(obj: any): string | null;
67
+ /**
68
+ * Fetches video list from a specific InnerTube browse ID, paginating if needed.
69
+ * @param apiKey - InnerTube API Key.
70
+ * @param clientVersion - InnerTube client version string.
71
+ * @param idToken - Identity Token.
72
+ * @param browseId - Target feed ID (e.g. 'FEhistory', 'VLLL', 'VLWL').
73
+ * @param limit - Maximum entries to fetch.
74
+ * @returns Array of videos.
75
+ */
76
+ declare function fetchInnerTubeFeed(apiKey: string, clientVersion: string, idToken: string | null, browseId: string, limit?: number): Promise<VideoEntry[]>;
77
+ /**
78
+ * Scrapes History, Liked videos, Watch Later, and any custom playlists.
79
+ * Tries the InnerTube JSON API first, then falls back to HTML-scraping + paginating if needed.
80
+ * @param injectedConfig - Preconfigured InnerTube parameters.
81
+ * @param customPlaylists - Custom playlist definitions with URLs/IDs.
82
+ * @param limit - Maximum items to retrieve per feed.
83
+ * @returns Scraped feeds.
84
+ */
85
+ declare function scrapeTasteData(injectedConfig?: Partial<InnerTubeConfig> | null, customPlaylists?: CustomPlaylist[], limit?: number): Promise<TasteData>;
86
+
87
+ declare class Base {
88
+ client: Client;
89
+ constructor(client: Client);
90
+ }
91
+
92
+ declare abstract class Continuable<T> extends Base {
93
+ items: T[];
94
+ continuation?: string | null;
95
+ private iteratorIndex;
96
+ protected abstract fetch(): Promise<{
97
+ items: T[];
98
+ continuation?: string | null;
99
+ }>;
100
+ next(count?: number): Promise<T[]>;
101
+ }
102
+
103
+ interface Thumbnail {
104
+ url: string;
105
+ width: number;
106
+ height: number;
107
+ }
108
+ declare class Thumbnails {
109
+ list: Thumbnail[];
110
+ constructor(list: Thumbnail[]);
111
+ getBestResolution(): Thumbnail | undefined;
112
+ }
113
+
114
+ interface ChannelInfo {
115
+ id?: string;
116
+ name: string;
117
+ thumbnails?: Thumbnails;
118
+ }
119
+ declare class VideoCompact extends Base {
120
+ id: string;
121
+ title: string;
122
+ thumbnails: Thumbnails;
123
+ duration: number | null;
124
+ isLive: boolean;
125
+ channel?: ChannelInfo;
126
+ viewCount: number | null;
127
+ publishedAt: string | null;
128
+ constructor(client: Client, data: any);
129
+ private parseDuration;
130
+ private parseViewCount;
131
+ }
132
+
133
+ declare class PlaylistCompact extends Base {
134
+ id: string;
135
+ title: string;
136
+ thumbnails: Thumbnails;
137
+ videoCount: number | null;
138
+ channel?: ChannelInfo;
139
+ constructor(client: Client, data: any);
140
+ }
141
+
142
+ declare class ChannelCompact extends Base {
143
+ id: string;
144
+ name: string;
145
+ thumbnails: Thumbnails;
146
+ subscriberCount: string | null;
147
+ constructor(client: Client, data: any);
148
+ }
149
+
150
+ type SearchItem = VideoCompact | PlaylistCompact | ChannelCompact;
151
+ declare class SearchResult extends Continuable<SearchItem> {
152
+ constructor(client: Client, initialData: any);
153
+ protected fetch(): Promise<{
154
+ items: SearchItem[];
155
+ continuation?: string | null;
156
+ }>;
157
+ private static parseData;
158
+ }
159
+
160
+ declare class BaseVideo extends Base {
161
+ id: string;
162
+ title: string;
163
+ description: string;
164
+ thumbnails: Thumbnails;
165
+ viewCount: number | null;
166
+ publishDate: string | null;
167
+ channel?: ChannelInfo;
168
+ isLive: boolean;
169
+ constructor(client: Client, data: any);
170
+ protected parse(data: any): void;
171
+ }
172
+
173
+ declare class Video extends BaseVideo {
174
+ constructor(client: Client, data: any);
175
+ }
176
+
177
+ declare class PlaylistVideos extends Continuable<VideoCompact> {
178
+ constructor(client: Client, initialData: any);
179
+ protected fetch(): Promise<{
180
+ items: VideoCompact[];
181
+ continuation?: string | null;
182
+ }>;
183
+ private static parseData;
184
+ }
185
+ declare class Playlist extends Base {
186
+ id: string;
187
+ title: string;
188
+ videoCount: number;
189
+ viewCount: number;
190
+ lastUpdated: string;
191
+ channel?: ChannelInfo;
192
+ videos: PlaylistVideos;
193
+ constructor(client: Client, data: any);
194
+ private parse;
195
+ }
196
+
197
+ /**
198
+ * client.ts
199
+ * Core InnerTube Client class for TubeVanilla.
200
+ * Optimized for client-side environments with zero external dependencies.
201
+ */
202
+
203
+ interface ClientOptions {
204
+ apiKey?: string | null;
205
+ clientVersion?: string;
206
+ idToken?: string | null;
207
+ cookie?: string;
208
+ }
209
+ declare class Client {
210
+ apiKey: string | null;
211
+ clientVersion: string;
212
+ idToken: string | null;
213
+ cookie: string;
214
+ constructor(options?: ClientOptions);
215
+ /**
216
+ * Asynchronously resolves config parameters if apiKey is not set yet.
217
+ * Fetches and parses YouTube's home page HTML using the scraper logic.
218
+ */
219
+ ensureConfig(): Promise<void>;
220
+ /**
221
+ * Dispatches an authenticated or unauthenticated POST request to the specified InnerTube endpoint.
222
+ */
223
+ request(endpoint: string, payload: any): Promise<any>;
224
+ /**
225
+ * Searches YouTube for the given query.
226
+ */
227
+ search(query: string, options?: {
228
+ type?: 'video' | 'playlist' | 'channel' | 'all';
229
+ }): Promise<SearchResult>;
230
+ /**
231
+ * Gets metadata for a specific video.
232
+ */
233
+ getVideo(videoId: string): Promise<Video>;
234
+ /**
235
+ * Gets metadata and videos for a specific playlist.
236
+ */
237
+ getPlaylist(playlistId: string): Promise<Playlist>;
238
+ }
239
+
240
+ /**
241
+ * comments.ts
242
+ * Scrapes YouTube video comments using InnerTube endpoints and HTML scraping.
243
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments).
244
+ */
245
+
246
+ interface CommentEntry {
247
+ author: string;
248
+ text: string;
249
+ publishedTime: string;
250
+ likeCount: number;
251
+ commentId: string;
252
+ }
253
+ interface CommentsApiRequestOptions {
254
+ headers: Record<string, string>;
255
+ body: string;
256
+ }
257
+ /**
258
+ * Creates options for the InnerTube /next API call to fetch comments.
259
+ * @param continuationToken - Continuation token for the next page of comments.
260
+ * @param clientVersion - YouTube client version.
261
+ * @returns Options with headers and stringified body.
262
+ */
263
+ declare function createCommentsApiRequestOptions(continuationToken: string, clientVersion?: string): CommentsApiRequestOptions;
264
+ /**
265
+ * Fetches comment list for a YouTube video, paginating with continuation tokens.
266
+ * @param videoId - The YouTube Video ID.
267
+ * @param count - Number of comments to retrieve.
268
+ * @param injectedConfig - InnerTube config parameters.
269
+ * @returns Scraped comments.
270
+ */
271
+ declare function fetchCommentsFromYouTube(videoId: string, count?: number, injectedConfig?: Partial<InnerTubeConfig> | null): Promise<CommentEntry[]>;
272
+
273
+ /**
274
+ * subtitles.ts
275
+ * Scrapes and parses subtitles/transcripts for a YouTube video.
276
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments) and server-side.
277
+ */
278
+ interface TranscriptSegment {
279
+ start: number;
280
+ duration: number;
281
+ text: string;
282
+ }
283
+ /**
284
+ * Extracts the `ytInitialPlayerResponse` or captions tracklist from the video page HTML.
285
+ * @param html - Raw HTML of the YouTube video watch page.
286
+ * @returns The playerResponse object or null.
287
+ */
288
+ declare function extractPlayerResponse(html: string): any;
289
+ /**
290
+ * Parses XML srv3/timedtext transcript format using regular expressions.
291
+ * @param xmlText - The raw XML transcript response.
292
+ * @returns Parsed transcript segments.
293
+ */
294
+ declare function parseXmlTranscriptRegex(xmlText: string): TranscriptSegment[];
295
+ /**
296
+ * Fetches and parses the subtitles/captions transcript for a video in the requested language.
297
+ * @param videoId - The YouTube Video ID.
298
+ * @param language - The desired language code (e.g. 'en', 'it', 'es').
299
+ * @returns Array of transcript segments.
300
+ */
301
+ declare function fetchSubtitlesFromYouTube(videoId: string, language?: string): Promise<TranscriptSegment[]>;
302
+
303
+ export { Base, BaseVideo, ChannelCompact, type ChannelInfo, Client, type ClientOptions, type CommentEntry, type CommentsApiRequestOptions, Continuable, type CustomPlaylist, type CustomPlaylistData, type InnerTubeConfig, Playlist, PlaylistCompact, PlaylistVideos, type SearchItem, SearchResult, type TasteData, type Thumbnail, Thumbnails, type TranscriptSegment, Video, VideoCompact, type VideoEntry, createCommentsApiRequestOptions, extractPlayerResponse, extractVideoEntries, fetchCommentsFromYouTube, fetchInnerTubeFeed, fetchSubtitlesFromYouTube, fetchYtInitialData, findContinuationToken, getInnerTubeConfig, getSApiSidHash, getSapisidFromCookie, parseXmlTranscriptRegex, scrapeTasteData };
@@ -0,0 +1,303 @@
1
+ /**
2
+ * scraper.ts
3
+ * Scrapes user-specific YouTube feeds: History, Likes, Watch Later, and Custom Playlists.
4
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments).
5
+ */
6
+ interface VideoEntry {
7
+ title: string;
8
+ channel: string;
9
+ }
10
+ interface InnerTubeConfig {
11
+ apiKey: string | null;
12
+ clientVersion: string;
13
+ idToken: string | null;
14
+ }
15
+ interface CustomPlaylist {
16
+ url: string;
17
+ }
18
+ interface CustomPlaylistData {
19
+ id: string;
20
+ entries: VideoEntry[];
21
+ }
22
+ interface TasteData {
23
+ historyEntries: VideoEntry[];
24
+ likesEntries: VideoEntry[];
25
+ wlEntries: VideoEntry[];
26
+ dislikesEntries: VideoEntry[];
27
+ customPlaylistsData: CustomPlaylistData[];
28
+ }
29
+ /**
30
+ * Fetches the HTML of a YouTube page and extracts `ytInitialData`.
31
+ * @param url - The URL to fetch.
32
+ * @returns The parsed ytInitialData object or null.
33
+ */
34
+ declare function fetchYtInitialData(url: string): Promise<any>;
35
+ /**
36
+ * Reads SAPISID cookies from the browser environment.
37
+ * Only works if running on a youtube.com domain or in an extension with cookie access.
38
+ * @returns The SAPISID value or null.
39
+ */
40
+ declare function getSapisidFromCookie(): string | null;
41
+ /**
42
+ * Generates the SAPISIDHASH Authorization header value needed for authenticated InnerTube requests.
43
+ * @param sapisid - The SAPISID cookie value.
44
+ * @param origin - The request origin.
45
+ * @returns The generated authorization hash or null.
46
+ */
47
+ declare function getSApiSidHash(sapisid: string, origin?: string): Promise<string | null>;
48
+ /**
49
+ * Recursively scans a JSON object to extract video entries { title, channel }.
50
+ * Handles both the legacy videoRenderer and the newer lockupViewModel schemas.
51
+ * @param data - The JSON object to search.
52
+ * @returns Array of extracted video entries.
53
+ */
54
+ declare function extractVideoEntries(data: any): VideoEntry[];
55
+ /**
56
+ * Extracts InnerTube credentials and configuration parameters by parsing the YouTube home page.
57
+ * @param injectedConfig - Pre-fetched config if available (bypasses fetching).
58
+ * @returns InnerTube config parameters.
59
+ */
60
+ declare function getInnerTubeConfig(injectedConfig?: Partial<InnerTubeConfig> | null): Promise<InnerTubeConfig>;
61
+ /**
62
+ * Recursively searches for the continuation token in an InnerTube response.
63
+ * @param obj - InnerTube response subtree.
64
+ * @returns The token or null.
65
+ */
66
+ declare function findContinuationToken(obj: any): string | null;
67
+ /**
68
+ * Fetches video list from a specific InnerTube browse ID, paginating if needed.
69
+ * @param apiKey - InnerTube API Key.
70
+ * @param clientVersion - InnerTube client version string.
71
+ * @param idToken - Identity Token.
72
+ * @param browseId - Target feed ID (e.g. 'FEhistory', 'VLLL', 'VLWL').
73
+ * @param limit - Maximum entries to fetch.
74
+ * @returns Array of videos.
75
+ */
76
+ declare function fetchInnerTubeFeed(apiKey: string, clientVersion: string, idToken: string | null, browseId: string, limit?: number): Promise<VideoEntry[]>;
77
+ /**
78
+ * Scrapes History, Liked videos, Watch Later, and any custom playlists.
79
+ * Tries the InnerTube JSON API first, then falls back to HTML-scraping + paginating if needed.
80
+ * @param injectedConfig - Preconfigured InnerTube parameters.
81
+ * @param customPlaylists - Custom playlist definitions with URLs/IDs.
82
+ * @param limit - Maximum items to retrieve per feed.
83
+ * @returns Scraped feeds.
84
+ */
85
+ declare function scrapeTasteData(injectedConfig?: Partial<InnerTubeConfig> | null, customPlaylists?: CustomPlaylist[], limit?: number): Promise<TasteData>;
86
+
87
+ declare class Base {
88
+ client: Client;
89
+ constructor(client: Client);
90
+ }
91
+
92
+ declare abstract class Continuable<T> extends Base {
93
+ items: T[];
94
+ continuation?: string | null;
95
+ private iteratorIndex;
96
+ protected abstract fetch(): Promise<{
97
+ items: T[];
98
+ continuation?: string | null;
99
+ }>;
100
+ next(count?: number): Promise<T[]>;
101
+ }
102
+
103
+ interface Thumbnail {
104
+ url: string;
105
+ width: number;
106
+ height: number;
107
+ }
108
+ declare class Thumbnails {
109
+ list: Thumbnail[];
110
+ constructor(list: Thumbnail[]);
111
+ getBestResolution(): Thumbnail | undefined;
112
+ }
113
+
114
+ interface ChannelInfo {
115
+ id?: string;
116
+ name: string;
117
+ thumbnails?: Thumbnails;
118
+ }
119
+ declare class VideoCompact extends Base {
120
+ id: string;
121
+ title: string;
122
+ thumbnails: Thumbnails;
123
+ duration: number | null;
124
+ isLive: boolean;
125
+ channel?: ChannelInfo;
126
+ viewCount: number | null;
127
+ publishedAt: string | null;
128
+ constructor(client: Client, data: any);
129
+ private parseDuration;
130
+ private parseViewCount;
131
+ }
132
+
133
+ declare class PlaylistCompact extends Base {
134
+ id: string;
135
+ title: string;
136
+ thumbnails: Thumbnails;
137
+ videoCount: number | null;
138
+ channel?: ChannelInfo;
139
+ constructor(client: Client, data: any);
140
+ }
141
+
142
+ declare class ChannelCompact extends Base {
143
+ id: string;
144
+ name: string;
145
+ thumbnails: Thumbnails;
146
+ subscriberCount: string | null;
147
+ constructor(client: Client, data: any);
148
+ }
149
+
150
+ type SearchItem = VideoCompact | PlaylistCompact | ChannelCompact;
151
+ declare class SearchResult extends Continuable<SearchItem> {
152
+ constructor(client: Client, initialData: any);
153
+ protected fetch(): Promise<{
154
+ items: SearchItem[];
155
+ continuation?: string | null;
156
+ }>;
157
+ private static parseData;
158
+ }
159
+
160
+ declare class BaseVideo extends Base {
161
+ id: string;
162
+ title: string;
163
+ description: string;
164
+ thumbnails: Thumbnails;
165
+ viewCount: number | null;
166
+ publishDate: string | null;
167
+ channel?: ChannelInfo;
168
+ isLive: boolean;
169
+ constructor(client: Client, data: any);
170
+ protected parse(data: any): void;
171
+ }
172
+
173
+ declare class Video extends BaseVideo {
174
+ constructor(client: Client, data: any);
175
+ }
176
+
177
+ declare class PlaylistVideos extends Continuable<VideoCompact> {
178
+ constructor(client: Client, initialData: any);
179
+ protected fetch(): Promise<{
180
+ items: VideoCompact[];
181
+ continuation?: string | null;
182
+ }>;
183
+ private static parseData;
184
+ }
185
+ declare class Playlist extends Base {
186
+ id: string;
187
+ title: string;
188
+ videoCount: number;
189
+ viewCount: number;
190
+ lastUpdated: string;
191
+ channel?: ChannelInfo;
192
+ videos: PlaylistVideos;
193
+ constructor(client: Client, data: any);
194
+ private parse;
195
+ }
196
+
197
+ /**
198
+ * client.ts
199
+ * Core InnerTube Client class for TubeVanilla.
200
+ * Optimized for client-side environments with zero external dependencies.
201
+ */
202
+
203
+ interface ClientOptions {
204
+ apiKey?: string | null;
205
+ clientVersion?: string;
206
+ idToken?: string | null;
207
+ cookie?: string;
208
+ }
209
+ declare class Client {
210
+ apiKey: string | null;
211
+ clientVersion: string;
212
+ idToken: string | null;
213
+ cookie: string;
214
+ constructor(options?: ClientOptions);
215
+ /**
216
+ * Asynchronously resolves config parameters if apiKey is not set yet.
217
+ * Fetches and parses YouTube's home page HTML using the scraper logic.
218
+ */
219
+ ensureConfig(): Promise<void>;
220
+ /**
221
+ * Dispatches an authenticated or unauthenticated POST request to the specified InnerTube endpoint.
222
+ */
223
+ request(endpoint: string, payload: any): Promise<any>;
224
+ /**
225
+ * Searches YouTube for the given query.
226
+ */
227
+ search(query: string, options?: {
228
+ type?: 'video' | 'playlist' | 'channel' | 'all';
229
+ }): Promise<SearchResult>;
230
+ /**
231
+ * Gets metadata for a specific video.
232
+ */
233
+ getVideo(videoId: string): Promise<Video>;
234
+ /**
235
+ * Gets metadata and videos for a specific playlist.
236
+ */
237
+ getPlaylist(playlistId: string): Promise<Playlist>;
238
+ }
239
+
240
+ /**
241
+ * comments.ts
242
+ * Scrapes YouTube video comments using InnerTube endpoints and HTML scraping.
243
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments).
244
+ */
245
+
246
+ interface CommentEntry {
247
+ author: string;
248
+ text: string;
249
+ publishedTime: string;
250
+ likeCount: number;
251
+ commentId: string;
252
+ }
253
+ interface CommentsApiRequestOptions {
254
+ headers: Record<string, string>;
255
+ body: string;
256
+ }
257
+ /**
258
+ * Creates options for the InnerTube /next API call to fetch comments.
259
+ * @param continuationToken - Continuation token for the next page of comments.
260
+ * @param clientVersion - YouTube client version.
261
+ * @returns Options with headers and stringified body.
262
+ */
263
+ declare function createCommentsApiRequestOptions(continuationToken: string, clientVersion?: string): CommentsApiRequestOptions;
264
+ /**
265
+ * Fetches comment list for a YouTube video, paginating with continuation tokens.
266
+ * @param videoId - The YouTube Video ID.
267
+ * @param count - Number of comments to retrieve.
268
+ * @param injectedConfig - InnerTube config parameters.
269
+ * @returns Scraped comments.
270
+ */
271
+ declare function fetchCommentsFromYouTube(videoId: string, count?: number, injectedConfig?: Partial<InnerTubeConfig> | null): Promise<CommentEntry[]>;
272
+
273
+ /**
274
+ * subtitles.ts
275
+ * Scrapes and parses subtitles/transcripts for a YouTube video.
276
+ * Works client-side (Chrome extensions, desktop apps, or CORS-proxied environments) and server-side.
277
+ */
278
+ interface TranscriptSegment {
279
+ start: number;
280
+ duration: number;
281
+ text: string;
282
+ }
283
+ /**
284
+ * Extracts the `ytInitialPlayerResponse` or captions tracklist from the video page HTML.
285
+ * @param html - Raw HTML of the YouTube video watch page.
286
+ * @returns The playerResponse object or null.
287
+ */
288
+ declare function extractPlayerResponse(html: string): any;
289
+ /**
290
+ * Parses XML srv3/timedtext transcript format using regular expressions.
291
+ * @param xmlText - The raw XML transcript response.
292
+ * @returns Parsed transcript segments.
293
+ */
294
+ declare function parseXmlTranscriptRegex(xmlText: string): TranscriptSegment[];
295
+ /**
296
+ * Fetches and parses the subtitles/captions transcript for a video in the requested language.
297
+ * @param videoId - The YouTube Video ID.
298
+ * @param language - The desired language code (e.g. 'en', 'it', 'es').
299
+ * @returns Array of transcript segments.
300
+ */
301
+ declare function fetchSubtitlesFromYouTube(videoId: string, language?: string): Promise<TranscriptSegment[]>;
302
+
303
+ export { Base, BaseVideo, ChannelCompact, type ChannelInfo, Client, type ClientOptions, type CommentEntry, type CommentsApiRequestOptions, Continuable, type CustomPlaylist, type CustomPlaylistData, type InnerTubeConfig, Playlist, PlaylistCompact, PlaylistVideos, type SearchItem, SearchResult, type TasteData, type Thumbnail, Thumbnails, type TranscriptSegment, Video, VideoCompact, type VideoEntry, createCommentsApiRequestOptions, extractPlayerResponse, extractVideoEntries, fetchCommentsFromYouTube, fetchInnerTubeFeed, fetchSubtitlesFromYouTube, fetchYtInitialData, findContinuationToken, getInnerTubeConfig, getSApiSidHash, getSapisidFromCookie, parseXmlTranscriptRegex, scrapeTasteData };