Added default exports
This commit is contained in:
parent
3f2bfcf3c6
commit
e235fdb127
@ -37,10 +37,7 @@ export function request_stream(req_url: string, options: RequestOpts = { method:
|
|||||||
* @param options Request options for https request
|
* @param options Request options for https request
|
||||||
* @returns A promise with the final response object
|
* @returns A promise with the final response object
|
||||||
*/
|
*/
|
||||||
function internalRequest(
|
function internalRequest(req_url: string, options: RequestOpts = { method: 'GET' }): Promise<IncomingMessage> {
|
||||||
req_url: string,
|
|
||||||
options: RequestOpts = { method: 'GET' }
|
|
||||||
): Promise<IncomingMessage> {
|
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let res = await https_getter(req_url, options).catch((err: Error) => err);
|
let res = await https_getter(req_url, options).catch((err: Error) => err);
|
||||||
if (res instanceof Error) {
|
if (res instanceof Error) {
|
||||||
|
|||||||
@ -298,7 +298,11 @@ export async function video_info(url: string, options: InfoOptions = {}): Promis
|
|||||||
* @returns Deciphered Video Info {@link InfoData}
|
* @returns Deciphered Video Info {@link InfoData}
|
||||||
*/
|
*/
|
||||||
export async function decipher_info<T extends InfoData | StreamInfoData>(data: T): Promise<T> {
|
export async function decipher_info<T extends InfoData | StreamInfoData>(data: T): Promise<T> {
|
||||||
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;
|
return data;
|
||||||
} else if (data.format[0].signatureCipher || data.format[0].cipher) {
|
} else if (data.format[0].signatureCipher || data.format[0].cipher) {
|
||||||
data.format = await format_decipher(data.format, data.html5player);
|
data.format = await format_decipher(data.format, data.html5player);
|
||||||
|
|||||||
@ -470,3 +470,57 @@ export function attachListeners(player: EventEmitter, resource: YouTubeStream |
|
|||||||
player.on(AudioPlayerStatus.Playing, resumeListener);
|
player.on(AudioPlayerStatus.Playing, resumeListener);
|
||||||
player.once(AudioPlayerStatus.Idle, idleListener);
|
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
|
||||||
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user