commit
e6c6e20b5d
@ -33,7 +33,6 @@ export class WebmSeeker extends Duplex {
|
|||||||
private data_length: number;
|
private data_length: number;
|
||||||
private sec: number;
|
private sec: number;
|
||||||
private time: number;
|
private time: number;
|
||||||
private foundCue: boolean;
|
|
||||||
|
|
||||||
constructor(sec: number, options: WebmSeekerOptions) {
|
constructor(sec: number, options: WebmSeekerOptions) {
|
||||||
super(options);
|
super(options);
|
||||||
@ -47,7 +46,6 @@ export class WebmSeeker extends Duplex {
|
|||||||
this.data_size = 0;
|
this.data_size = 0;
|
||||||
this.sec = sec;
|
this.sec = sec;
|
||||||
this.time = Math.floor(sec / 10) * 10;
|
this.time = Math.floor(sec / 10) * 10;
|
||||||
this.foundCue = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private get vint_length(): number {
|
private get vint_length(): number {
|
||||||
@ -143,15 +141,11 @@ export class WebmSeeker extends Duplex {
|
|||||||
if (parse instanceof Error) return parse;
|
if (parse instanceof Error) return parse;
|
||||||
|
|
||||||
// stop parsing the header once we have found the correct cue
|
// stop parsing the header once we have found the correct cue
|
||||||
if (ebmlID.name === 'cueClusterPosition') {
|
if (
|
||||||
if (this.foundCue) {
|
ebmlID.name === 'cueClusterPosition' &&
|
||||||
this.emit('headComplete');
|
this.time === (this.header.segment.cues!.at(-1)!.time as number) / 1000
|
||||||
this.cursor = this.chunk.length;
|
)
|
||||||
break;
|
this.emit('headComplete');
|
||||||
} else if (this.time === (this.header.segment.cues!.at(-1)!.time as number) / 1000) {
|
|
||||||
this.foundCue = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ebmlID.type === DataType.master) {
|
if (ebmlID.type === DataType.master) {
|
||||||
this.cursor += this.data_size;
|
this.cursor += this.data_size;
|
||||||
|
|||||||
@ -211,7 +211,8 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
|
|||||||
music.push({});
|
music.push({});
|
||||||
music[music.length - 1].song =
|
music[music.length - 1].song =
|
||||||
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
|
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
|
||||||
} else
|
} else if (music.length === 0) return;
|
||||||
|
else
|
||||||
music[music.length - 1][x.metadataRowRenderer.title.simpleText.toLowerCase()] =
|
music[music.length - 1][x.metadataRowRenderer.title.simpleText.toLowerCase()] =
|
||||||
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
|
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user