thumbnailUrl?: string
}
-function getYoutubeDLInfo (url: string): Promise<YoutubeDLInfo> {
+function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
return new Promise<YoutubeDLInfo>(async (res, rej) => {
- const options = [ '-j', '--flat-playlist' ]
+ const options = opts || [ '-j', '--flat-playlist' ]
const youtubeDL = await safeGetYoutubeDL()
youtubeDL.getInfo(url, options, (err, info) => {
})
}
-// ---------------------------------------------------------------------------
-
-export {
- updateYoutubeDLBinary,
- downloadYoutubeDLVideo,
- getYoutubeDLInfo
-}
-
-// ---------------------------------------------------------------------------
-
async function safeGetYoutubeDL () {
let youtubeDL
return youtubeDL
}
+// ---------------------------------------------------------------------------
+
+export {
+ updateYoutubeDLBinary,
+ downloadYoutubeDLVideo,
+ getYoutubeDLInfo,
+ safeGetYoutubeDL
+}
+
+// ---------------------------------------------------------------------------
+
function normalizeObject (obj: any) {
const newObj: any = {}