mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 12:31:17 +00:00
feat: Add support for retrieving transcripts (#500)
* feat: Add support for retrieving transcripts * chore: lint * chore: update docs * chore: Do not include nodes in errors thrown * chore: Improve error messages * fix(ExpandableMetadata): `expanded_content` type mismatch * chore: lint
This commit is contained in:
22
src/parser/classes/TranscriptSegment.ts
Normal file
22
src/parser/classes/TranscriptSegment.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
import { Text } from '../misc.js';
|
||||
|
||||
export default class TranscriptSegment extends YTNode {
|
||||
static type = 'TranscriptSegment';
|
||||
|
||||
start_ms: string;
|
||||
end_ms: string;
|
||||
snippet: Text;
|
||||
start_time_text: Text;
|
||||
target_id: string;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.start_ms = data.startMs;
|
||||
this.end_ms = data.endMs;
|
||||
this.snippet = new Text(data.snippet);
|
||||
this.start_time_text = new Text(data.startTimeText);
|
||||
this.target_id = data.targetId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user