From e60e71125e10ec32b2a4c3088bb9834940dc9169 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Fri, 11 Feb 2022 18:35:17 +0530 Subject: [PATCH] Added liveAt property in YouTube Video --- package-lock.json | 4 ++-- play-dl/YouTube/classes/Video.ts | 5 +++++ play-dl/YouTube/utils/extractor.ts | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b4118c..9296eb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "play-dl", - "version": "1.8.6", + "version": "1.8.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "play-dl", - "version": "1.8.6", + "version": "1.8.7", "license": "GPL-3.0", "dependencies": { "play-audio": "^0.5.2" diff --git a/play-dl/YouTube/classes/Video.ts b/play-dl/YouTube/classes/Video.ts index 8cdb9a1..67682d0 100644 --- a/play-dl/YouTube/classes/Video.ts +++ b/play-dl/YouTube/classes/Video.ts @@ -119,6 +119,10 @@ export class YouTubeVideo { * YouTube Video Uploaded Date */ uploadedAt?: string; + /** + * YouTube Live Date + */ + liveAt?: string; /** * If the video is upcoming or a premiere that isn't currently live, this will contain the premiere date, for watch page playlists this will be true, it defaults to undefined */ @@ -174,6 +178,7 @@ export class YouTubeVideo { this.durationRaw = data.duration_raw || '0:00'; this.durationInSec = (data.duration < 0 ? 0 : data.duration) || 0; this.uploadedAt = data.uploadedAt || undefined; + this.liveAt = data.liveAt || undefined; this.upcoming = data.upcoming; this.views = parseInt(data.views) || 0; const thumbnails = []; diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index 6c8afca..5a57968 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -244,6 +244,7 @@ export async function video_basic_info(url: string, options: InfoOptions = {}): duration: Number(vid.lengthSeconds), duration_raw: parseSeconds(vid.lengthSeconds), uploadedAt: microformat.publishDate, + liveAt: microformat.liveBroadcastDetails?.startTimestamp, upcoming: upcomingDate, thumbnails: vid.thumbnail.thumbnails, channel: {