music property issue fixed
This commit is contained in:
parent
da91f6a1ec
commit
3ae4cea5a8
@ -131,7 +131,7 @@ export class SeekStream {
|
|||||||
this.timer.reuse();
|
this.timer.reuse();
|
||||||
return this.seek(sec);
|
return this.seek(sec);
|
||||||
}
|
}
|
||||||
const bytes = this.stream.seek(parseFloat(sec.toFixed(2)));
|
const bytes = this.stream.seek(sec);
|
||||||
if (bytes instanceof Error) {
|
if (bytes instanceof Error) {
|
||||||
this.stream.emit('error', bytes);
|
this.stream.emit('error', bytes);
|
||||||
this.bytes_count = 0;
|
this.bytes_count = 0;
|
||||||
|
|||||||
@ -205,20 +205,17 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
|
|||||||
?.metadataRowContainer?.metadataRowContainerRenderer?.rows;
|
?.metadataRowContainer?.metadataRowContainerRenderer?.rows;
|
||||||
const music: any[] = [];
|
const music: any[] = [];
|
||||||
if (musicInfo) {
|
if (musicInfo) {
|
||||||
let incompleteInfo: any = {};
|
|
||||||
musicInfo.forEach((x: any) => {
|
musicInfo.forEach((x: any) => {
|
||||||
if (!x.metadataRowRenderer) return;
|
if (!x.metadataRowRenderer) return;
|
||||||
if (x.metadataRowRenderer.title.simpleText.toLowerCase() === 'song') {
|
if (x.metadataRowRenderer.title.simpleText.toLowerCase() === 'song') {
|
||||||
music.push(incompleteInfo);
|
music.push({});
|
||||||
incompleteInfo = {};
|
music[music.length - 1].song =
|
||||||
incompleteInfo.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
|
||||||
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;
|
x.metadataRowRenderer.contents[0].simpleText ?? x.metadataRowRenderer.contents[0]?.runs?.[0]?.text;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
music.shift();
|
|
||||||
const video_details = new YouTubeVideo({
|
const video_details = new YouTubeVideo({
|
||||||
id: vid.videoId,
|
id: vid.videoId,
|
||||||
title: vid.title,
|
title: vid.title,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user