Rename function to decipher_info
This commit is contained in:
parent
f1be72088f
commit
75f475ef4b
@ -86,14 +86,14 @@ const video = await video_info(url)
|
|||||||
console.log(video.format)
|
console.log(video.format)
|
||||||
```
|
```
|
||||||
|
|
||||||
### video_info_from_basic_info(data : `InfoData`)
|
### decipher_info(data : `InfoData`)
|
||||||
|
|
||||||
_This contains everything with deciphered formats along with `video_details`. It uses data returned by [`video_basic_info`](https://github.com/play-dl/play-dl/tree/main/docs/YouTube#video_basic_infourl--string-options--infooptions). This function is useful if you use [`video_basic_info`](https://github.com/play-dl/play-dl/tree/main/docs/YouTube#video_basic_infourl--string-options--infooptions) earlier in your code and want to convert the output for use with [`stream_from_info`](https://github.com/play-dl/play-dl/tree/main/docs#stream_from_infoinfo--infodata-options--streamoptions)_
|
_This contains everything with deciphered formats along with `video_details`. It uses data returned by [`video_basic_info`](https://github.com/play-dl/play-dl/tree/main/docs/YouTube#video_basic_infourl--string-options--infooptions). This function is useful if you use [`video_basic_info`](https://github.com/play-dl/play-dl/tree/main/docs/YouTube#video_basic_infourl--string-options--infooptions) earlier in your code and want to convert the output for use with [`stream_from_info`](https://github.com/play-dl/play-dl/tree/main/docs#stream_from_infoinfo--infodata-options--streamoptions)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const basic_video = await video_basic_info(url);
|
const basic_video = await video_basic_info(url);
|
||||||
|
|
||||||
const video = await video_info_from_basic_info(basic_video);
|
const video = await decipher_info(basic_video);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Playlist
|
## Playlist
|
||||||
|
|||||||
@ -85,7 +85,7 @@ export async function stream(url: string, options: StreamOptions = {}): Promise<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Stream command for YouTube using info from video_info or video_info_from_basic_info function.
|
* Stream command for YouTube using info from video_info or decipher_info function.
|
||||||
* @param info video_info data
|
* @param info video_info data
|
||||||
* @param options lets you add quality, cookie, proxy support for stream
|
* @param options lets you add quality, cookie, proxy support for stream
|
||||||
* @returns Stream class with type and stream for playing.
|
* @returns Stream class with type and stream for playing.
|
||||||
|
|||||||
@ -182,7 +182,7 @@ export async function video_info(url: string, options: InfoOptions = {}) {
|
|||||||
* @param data basic_video_info data
|
* @param data basic_video_info data
|
||||||
* @returns Data containing video_details, LiveStreamData and formats of video url.
|
* @returns Data containing video_details, LiveStreamData and formats of video url.
|
||||||
*/
|
*/
|
||||||
export async function video_info_from_basic_info(data: InfoData) {
|
export async function decipher_info(data: InfoData) {
|
||||||
if (data.LiveStreamData.isLive === true && data.LiveStreamData.hlsManifestUrl !== null) {
|
if (data.LiveStreamData.isLive === true && data.LiveStreamData.hlsManifestUrl !== null) {
|
||||||
return data;
|
return data;
|
||||||
} else if (data.format[0].signatureCipher || data.format[0].cipher) {
|
} else if (data.format[0].signatureCipher || data.format[0].cipher) {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
export {
|
export {
|
||||||
video_basic_info,
|
video_basic_info,
|
||||||
video_info,
|
video_info,
|
||||||
video_info_from_basic_info,
|
decipher_info,
|
||||||
playlist_info,
|
playlist_info,
|
||||||
yt_validate,
|
yt_validate,
|
||||||
extractID
|
extractID
|
||||||
|
|||||||
@ -2,7 +2,7 @@ export {
|
|||||||
playlist_info,
|
playlist_info,
|
||||||
video_basic_info,
|
video_basic_info,
|
||||||
video_info,
|
video_info,
|
||||||
video_info_from_basic_info,
|
decipher_info,
|
||||||
yt_validate,
|
yt_validate,
|
||||||
extractID,
|
extractID,
|
||||||
YouTube,
|
YouTube,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user