mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Added URL to properties in music object (#280)
* Added URL endpoints to licensed music object * Added URL info to properties in music object * Added URL to properties in music object * Added URL support for the Video Music properties with typings * Added URL to music properties in YoutubeVideo * Fixed Typings * Added footnote to music property
This commit is contained in:
@@ -223,10 +223,11 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
|
||||
|
||||
const title = row.title.simpleText ?? row.title.runs[0].text;
|
||||
const contents = row.contents[0].simpleText ?? row.contents[0]?.runs?.[0]?.text;
|
||||
const url = row.contents[0]?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata.url;
|
||||
|
||||
if (music.length === 0) music.push({});
|
||||
|
||||
music[music.length - 1][title.toLowerCase()] = contents;
|
||||
music[music.length - 1][title.toLowerCase()] = url ? {text: contents, url: `https://www.youtube.com${url}`} : contents;
|
||||
|
||||
if (row.hasDividerLine) music.push({});
|
||||
});
|
||||
@@ -854,4 +855,4 @@ function parseDuration(text: string): number {
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user