Merge pull request #208 from play-dl/developer

1.6.1
This commit is contained in:
Killer069 2021-12-17 15:40:06 +05:30 committed by GitHub
commit cb5796f15a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 6 deletions

View File

@ -45,7 +45,7 @@ const { video_basic_info, stream } = require('play-dl');
**ES6 modules:**
```ts
import * as play from 'play-dl'; // Everything
import play from 'play-dl'; // Everything
import { video_basic_info, stream } from 'play-dl'; // Individual functions
```

View File

@ -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<IncomingMessage> {
function internalRequest(req_url: string, options: RequestOpts = { method: 'GET' }): Promise<IncomingMessage> {
return new Promise(async (resolve, reject) => {
let res = await https_getter(req_url, options).catch((err: Error) => err);
if (res instanceof Error) {

View File

@ -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<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;
} else if (data.format[0].signatureCipher || data.format[0].cipher) {
data.format = await format_decipher(data.format, data.html5player);

View File

@ -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
};