mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
added cookie parameter in retry options
This commit is contained in:
@@ -50,7 +50,7 @@ export async function stream(url : string, cookie? : string): Promise<Stream | L
|
|||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
if(resp === 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()
|
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))
|
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 final: any[] = [];
|
||||||
let type : StreamType;
|
let type : StreamType;
|
||||||
if(info.LiveStreamData.isLive === true && info.LiveStreamData.hlsManifestUrl !== null && info.video_details.durationInSec === '0') {
|
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
|
return 0
|
||||||
})
|
})
|
||||||
if(resp === 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()
|
else if(typeof resp !== "number") resp.destroy()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user