added cookie parameter in retry options

This commit is contained in:
Killer069 2021-09-07 13:00:17 +05:30 committed by GitHub
parent fb04bbed4d
commit 3cd8d36aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ export async function stream(url : string, cookie? : string): Promise<Stream | L
return 0
})
if(resp === 0){
return await stream(info.video_details.url)
return await stream(info.video_details.url, cookie)
}
else if(typeof resp !== "number") resp.destroy()
@ -74,7 +74,7 @@ export async function stream(url : string, cookie? : string): Promise<Stream | L
return new Stream(final[0].url, type, info.video_details.durationInSec, Number(final[0].contentLength))
}
export async function stream_from_info(info : InfoData): Promise<Stream | LiveStreaming>{
export async function stream_from_info(info : InfoData, cookie? : string): Promise<Stream | LiveStreaming>{
let final: any[] = [];
let type : StreamType;
if(info.LiveStreamData.isLive === true && info.LiveStreamData.hlsManifestUrl !== null && info.video_details.durationInSec === '0') {
@ -90,7 +90,7 @@ export async function stream_from_info(info : InfoData): Promise<Stream | LiveSt
return 0
})
if(resp === 0){
return await stream(info.video_details.url)
return await stream(info.video_details.url, cookie)
}
else if(typeof resp !== "number") resp.destroy()