From e235fdb1271e5c4bda63427161f57f7ea0c2a658 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:24:12 +0530 Subject: [PATCH] Added default exports --- play-dl/Request/index.ts | 5 +-- play-dl/YouTube/utils/extractor.ts | 6 +++- play-dl/index.ts | 54 ++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/play-dl/Request/index.ts b/play-dl/Request/index.ts index fd28cdf..44881b0 100644 --- a/play-dl/Request/index.ts +++ b/play-dl/Request/index.ts @@ -37,10 +37,7 @@ export function request_stream(req_url: string, options: RequestOpts = { method: * @param options Request options for https request * @returns A promise with the final response object */ -function internalRequest( - req_url: string, - options: RequestOpts = { method: 'GET' } -): Promise { +function internalRequest(req_url: string, options: RequestOpts = { method: 'GET' }): Promise { return new Promise(async (resolve, reject) => { let res = await https_getter(req_url, options).catch((err: Error) => err); if (res instanceof Error) { diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index 1a82901..1d7addf 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -298,7 +298,11 @@ export async function video_info(url: string, options: InfoOptions = {}): Promis * @returns Deciphered Video Info {@link InfoData} */ export async function decipher_info(data: T): Promise { - if (data.LiveStreamData.isLive === true && data.LiveStreamData.dashManifestUrl !== null) { + if ( + data.LiveStreamData.isLive === true && + data.LiveStreamData.dashManifestUrl !== null && + data.video_details.durationInSec === 0 + ) { return data; } else if (data.format[0].signatureCipher || data.format[0].cipher) { data.format = await format_decipher(data.format, data.html5player); diff --git a/play-dl/index.ts b/play-dl/index.ts index 9a71b85..1bb420f 100644 --- a/play-dl/index.ts +++ b/play-dl/index.ts @@ -470,3 +470,57 @@ export function attachListeners(player: EventEmitter, resource: YouTubeStream | player.on(AudioPlayerStatus.Playing, resumeListener); player.once(AudioPlayerStatus.Idle, idleListener); } + +import { + decipher_info, + deezer, + dz_advanced_track_search, + extractID, + getFreeClientID, + is_expired, + playlist_info, + refreshToken, + setToken, + soundcloud, + spotify, + video_basic_info, + video_info +} from '.'; + +export default { + DeezerAlbum, + DeezerPlaylist, + DeezerTrack, + SoundCloudPlaylist, + SoundCloudStream, + SoundCloudTrack, + SpotifyAlbum, + SpotifyPlaylist, + SpotifyTrack, + YouTubeChannel, + YouTubePlayList, + YouTubeVideo, + attachListeners, + authorization, + decipher_info, + deezer, + dz_advanced_track_search, + dz_validate, + extractID, + getFreeClientID, + is_expired, + playlist_info, + refreshToken, + search, + setToken, + so_validate, + soundcloud, + spotify, + sp_validate, + stream, + stream_from_info, + validate, + video_basic_info, + video_info, + yt_validate +};