youtubei 1.5.2 → 1.5.3
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.
|
@@ -70,7 +70,8 @@ class VideoCaptions extends Base_1.Base {
|
|
|
70
70
|
curr.push(new Caption_1.Caption({
|
|
71
71
|
duration: e.dDurationMs,
|
|
72
72
|
start: e.tStartMs,
|
|
73
|
-
text: (_a = e.segs) === null || _a === void 0 ? void 0 : _a.map((s) =>
|
|
73
|
+
text: (_a = e.segs) === null || _a === void 0 ? void 0 : _a.map((s) => s.utf8).join(),
|
|
74
|
+
segments: e.segs,
|
|
74
75
|
}));
|
|
75
76
|
return curr;
|
|
76
77
|
}, []);
|
|
@@ -119,7 +119,8 @@ var VideoCaptions = /** @class */ (function (_super) {
|
|
|
119
119
|
curr.push(new Caption({
|
|
120
120
|
duration: e.dDurationMs,
|
|
121
121
|
start: e.tStartMs,
|
|
122
|
-
text: (_a = e.segs) === null || _a === void 0 ? void 0 : _a.map(function (s) { return
|
|
122
|
+
text: (_a = e.segs) === null || _a === void 0 ? void 0 : _a.map(function (s) { return s.utf8; }).join(),
|
|
123
|
+
segments: e.segs,
|
|
123
124
|
}));
|
|
124
125
|
return curr;
|
|
125
126
|
}, []);
|
|
@@ -3,7 +3,13 @@ interface CaptionProperties {
|
|
|
3
3
|
text?: string;
|
|
4
4
|
start?: number;
|
|
5
5
|
duration?: number;
|
|
6
|
+
segments?: CaptionSegment[];
|
|
6
7
|
}
|
|
8
|
+
declare type CaptionSegment = {
|
|
9
|
+
utf8: string;
|
|
10
|
+
tOffsetMs?: number;
|
|
11
|
+
acAsrConf: number;
|
|
12
|
+
};
|
|
7
13
|
/**
|
|
8
14
|
* Represent a single video caption entry
|
|
9
15
|
*/
|
|
@@ -14,6 +20,8 @@ export declare class Caption implements CaptionProperties {
|
|
|
14
20
|
start: number;
|
|
15
21
|
/** caption duration in milliseconds */
|
|
16
22
|
duration: number;
|
|
23
|
+
/** caption duration in milliseconds */
|
|
24
|
+
segments: CaptionSegment[];
|
|
17
25
|
/** @hidden */
|
|
18
26
|
constructor(attr?: CaptionProperties);
|
|
19
27
|
/** transcript end time in milliseconds */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Simple package to get information from youtube such as videos, playlists, channels, video information & comments, related videos, up next video, and more!",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|