From 46cf8e48bd1cff5718497a07a1aebe2cb1495a63 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:27:10 +0530 Subject: [PATCH] 0.9.6 --- package-lock.json | 4 ++-- package.json | 2 +- play-dl/YouTube/classes/LiveStream.ts | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 505207d..a8d36d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "play-dl", - "version": "0.9.6", + "version": "0.9.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "play-dl", - "version": "0.9.6", + "version": "0.9.7", "license": "MIT", "devDependencies": { "@types/node": "^16.9.1" diff --git a/package.json b/package.json index 755d7df..066070c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "play-dl", - "version": "0.9.6", + "version": "0.9.7", "description": "YouTube, SoundCloud, Spotify streaming for discord.js bots", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/play-dl/YouTube/classes/LiveStream.ts b/play-dl/YouTube/classes/LiveStream.ts index 8674562..abe7a98 100644 --- a/play-dl/YouTube/classes/LiveStream.ts +++ b/play-dl/YouTube/classes/LiveStream.ts @@ -129,7 +129,7 @@ export class Stream { this.bytes_count = 0 this.video_url = video_url this.cookie = cookie - this.timer = setInterval(() => { + this.timer = setTimeout(() => { this.retry() }, 7200 * 1000) this.per_sec_bytes = Math.ceil(contentLength / duration) @@ -157,6 +157,9 @@ export class Stream { private async retry(){ let info = await video_info(this.video_url, this.cookie) this.url = info.format[info.format.length - 1].url + this.timer = setTimeout(() => { + this.retry() + }, 7200 * 1000) } private cleanup(){