mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
timer issues fixed - 0.9.9
This commit is contained in:
@@ -129,7 +129,7 @@ export class Stream {
|
|||||||
this.bytes_count = 0
|
this.bytes_count = 0
|
||||||
this.video_url = video_url
|
this.video_url = video_url
|
||||||
this.cookie = cookie
|
this.cookie = cookie
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setInterval(() => {
|
||||||
this.retry()
|
this.retry()
|
||||||
}, 7200 * 1000)
|
}, 7200 * 1000)
|
||||||
this.per_sec_bytes = Math.ceil(contentLength / duration)
|
this.per_sec_bytes = Math.ceil(contentLength / duration)
|
||||||
@@ -159,9 +159,6 @@ export class Stream {
|
|||||||
private async retry(){
|
private async retry(){
|
||||||
let info = await video_info(this.video_url, this.cookie)
|
let info = await video_info(this.video_url, this.cookie)
|
||||||
this.url = info.format[info.format.length - 1].url
|
this.url = info.format[info.format.length - 1].url
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.retry()
|
|
||||||
}, 7200 * 1000)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private cleanup(){
|
private cleanup(){
|
||||||
@@ -187,6 +184,11 @@ export class Stream {
|
|||||||
this.cleanup()
|
this.cleanup()
|
||||||
await this.retry()
|
await this.retry()
|
||||||
this.loop()
|
this.loop()
|
||||||
|
if(!this.timer){
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.retry()
|
||||||
|
}, 7200 * 1000)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.request = stream
|
this.request = stream
|
||||||
|
|||||||
Reference in New Issue
Block a user