From bca50b2395a471908f0d8e3c1f74a8077fc1539c Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Wed, 1 Sep 2021 11:11:30 +0530 Subject: [PATCH] Small Patch for long streams --- package-lock.json | 4 ++-- package.json | 2 +- play-dl/YouTube/classes/LiveStream.ts | 2 +- play-dl/YouTube/utils/extractor.ts | 1 + play-dl/index.ts | 8 +++++++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 27757fd..de01289 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "play-dl", - "version": "0.7.3", + "version": "0.7.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "play-dl", - "version": "0.7.3", + "version": "0.7.4", "license": "MIT", "dependencies": { "got": "^11.8.2" diff --git a/package.json b/package.json index 625fcdb..dc7b292 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "play-dl", - "version": "0.7.3", + "version": "0.7.4", "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 f2771cb..8edfaff 100644 --- a/play-dl/YouTube/classes/LiveStream.ts +++ b/play-dl/YouTube/classes/LiveStream.ts @@ -276,6 +276,6 @@ export class Stream { this.timer = setTimeout(() => { this.loop() - }, 300 * 1000) + }, 280 * 1000) } } diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index fd4d2a7..f14474b 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -37,6 +37,7 @@ export async function video_basic_info(url : string){ let html5player = 'https://www.youtube.com' + body.split('"jsUrl":"')[1].split('"')[0] let format = [] let vid = player_response.videoDetails + console.log(vid.thumbnail.thumbnails) let microformat = player_response.microformat.playerMicroformatRenderer let video_details = { id : vid.videoId, diff --git a/play-dl/index.ts b/play-dl/index.ts index 384515b..ea91906 100644 --- a/play-dl/index.ts +++ b/play-dl/index.ts @@ -1 +1,7 @@ -export { playlist_info, video_basic_info, video_info, search, stream, stream_from_info, validate, validate_playlist } from "./YouTube"; \ No newline at end of file +export { playlist_info, video_basic_info, video_info, search, stream, stream_from_info, validate, validate_playlist } from "./YouTube"; + +import { video_basic_info } from '.' + +(async() => { + let vid = await video_basic_info('https://www.youtube.com/watch?v=ALZHF5UqnU4') +})() \ No newline at end of file