Skip to content

Commit

Permalink
Merge pull request #234 from play-dl/developer
Browse files Browse the repository at this point in the history
1.7.6
  • Loading branch information
iim-ayush committed Jan 7, 2022
2 parents ce45f3c + a651979 commit e6c6e20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
16 changes: 5 additions & 11 deletions play-dl/YouTube/classes/WebmSeeker.ts
Expand Up @@ -33,7 +33,6 @@ export class WebmSeeker extends Duplex {
private data_length: number;
private sec: number;
private time: number;
private foundCue: boolean;

constructor(sec: number, options: WebmSeekerOptions) {
super(options);
Expand All @@ -47,7 +46,6 @@ export class WebmSeeker extends Duplex {
this.data_size = 0;
this.sec = sec;
this.time = Math.floor(sec / 10) * 10;
this.foundCue = false;
}

private get vint_length(): number {
Expand Down Expand Up @@ -143,15 +141,11 @@ export class WebmSeeker extends Duplex {
if (parse instanceof Error) return parse;

// stop parsing the header once we have found the correct cue
if (ebmlID.name === 'cueClusterPosition') {
if (this.foundCue) {
this.emit('headComplete');
this.cursor = this.chunk.length;
break;
} else if (this.time === (this.header.segment.cues!.at(-1)!.time as number) / 1000) {
this.foundCue = true;
}
}
if (
ebmlID.name === 'cueClusterPosition' &&
this.time === (this.header.segment.cues!.at(-1)!.time as number) / 1000
)
this.emit('headComplete');

if (ebmlID.type === DataType.master) {
this.cursor += this.data_size;
Expand Down
3 changes: 2 additions & 1 deletion play-dl/YouTube/utils/extractor.ts
Expand Up @@ -211,7 +211,8 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
music.push({});
music[music.length - 1].song =
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()] =
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
});
Expand Down

0 comments on commit e6c6e20

Please sign in to comment.