Skip to content

Commit

Permalink
music property issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
iim-ayush committed Jan 4, 2022
1 parent da91f6a commit 3ae4cea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion play-dl/YouTube/classes/SeekStream.ts
Expand Up @@ -131,7 +131,7 @@ export class SeekStream {
this.timer.reuse();
return this.seek(sec);
}
const bytes = this.stream.seek(parseFloat(sec.toFixed(2)));
const bytes = this.stream.seek(sec);
if (bytes instanceof Error) {
this.stream.emit('error', bytes);
this.bytes_count = 0;
Expand Down
9 changes: 3 additions & 6 deletions play-dl/YouTube/utils/extractor.ts
Expand Up @@ -205,20 +205,17 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
?.metadataRowContainer?.metadataRowContainerRenderer?.rows;
const music: any[] = [];
if (musicInfo) {
let incompleteInfo: any = {};
musicInfo.forEach((x: any) => {
if (!x.metadataRowRenderer) return;
if (x.metadataRowRenderer.title.simpleText.toLowerCase() === 'song') {
music.push(incompleteInfo);
incompleteInfo = {};
incompleteInfo.song =
music.push({});
music[music.length - 1].song =
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
} else
incompleteInfo[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;
});
}
music.shift();
const video_details = new YouTubeVideo({
id: vid.videoId,
title: vid.title,
Expand Down

0 comments on commit 3ae4cea

Please sign in to comment.