Updated Docs

This commit is contained in:
killer069 2021-09-28 21:25:41 +05:30
parent 20984ce9e9
commit 8e96e24aeb
2 changed files with 44 additions and 12 deletions

View File

@ -77,6 +77,7 @@ let data = await search('Rick Roll', { limit: 1, source : { soundcloud : "tracks
- quality : `number` :- Sets quality of stream [ 0 = Lowest, 1 = Medium ]. Leave this empty to get highest audio quality. - quality : `number` :- Sets quality of stream [ 0 = Lowest, 1 = Medium ]. Leave this empty to get highest audio quality.
- cookie : `string` :- **[Cookies](https://github.com/play-dl/play-dl/discussions/34)** are optional and are required for playing age restricted videos. - cookie : `string` :- **[Cookies](https://github.com/play-dl/play-dl/discussions/34)** are optional and are required for playing age restricted videos.
- proxy : `Proxy` :- Optional parameter to add support of proxies. As of now, HTTPS proxies are only supported. So make sure to get HTTPS proxies only.
#### stream(url : `string`, options? : [`StreamOptions`](https://github.com/play-dl/play-dl/tree/main/docs#streamoptions-)) #### stream(url : `string`, options? : [`StreamOptions`](https://github.com/play-dl/play-dl/tree/main/docs#streamoptions-))
@ -91,6 +92,14 @@ let source = await stream("url", { quality : 1 }) // Next to Lowest quality.
let source = await stream("url", { cookie: COOKIE }) //This will create a stream Class and also give cookies. let source = await stream("url", { cookie: COOKIE }) //This will create a stream Class and also give cookies.
let source = await stream(url, { proxy : ['url'] }) // Accepts a url which has port in in it.
let source = await stream(url. {proxy : [{
host : "IP or hostname",
port : 8080
}]
}) // Or add a json containing hostname and port.
let resource = createAudioResource(source.stream, { let resource = createAudioResource(source.stream, {
inputType : source.type inputType : source.type
}) // This creates resource for playing }) // This creates resource for playing
@ -104,7 +113,7 @@ _This is basic to create a stream from a info [ from [video_info](https://github
```js ```js
let source = await stream_from_info(info) // This will create a stream Class from video_info or SoundCoudTrack Class. Highest Quality let source = await stream_from_info(info) // This will create a stream Class from video_info or SoundCoudTrack Class. Highest Quality
let source = await stream_from_info(info, { quality : 0 }) // Lowest quality let source = await stream_from_info(info, { quality : 0 }) // Lowest quality
let source = await stream_from_info(info, { quality : 1 }) // Next to Lowest quality. let source = await stream_from_info(info, { quality : 1 }) // Next to Lowest quality.
@ -112,7 +121,15 @@ let source = await stream_from_info(info, { quality : 1 }) // Next to Lowest qua
let source = await stream_from_info(info, { cookie: COOKIE }) //This will create a stream Class and also give cookies if retrying. let source = await stream_from_info(info, { cookie: COOKIE }) //This will create a stream Class and also give cookies if retrying.
let resource = createAudioResource(source.stream, { let source = await stream_from_info(url, { proxy : ['url'] }) // Accepts a url which has port in in it.
let source = await stream_from_info(url. {proxy : [{
host : "IP or hostname",
port : 8080
}]
}) // Or add a json containing hostname and port.
let resource = createAudioResource(source.stream, {
inputType : source.type inputType : source.type
}) // This creates resource for playing }) // This creates resource for playing
``` ```

View File

@ -43,22 +43,37 @@ let id = extractID(url)
## Video ## Video
### video_basic_info(url : `string`, cookie? : `string`) ### InfoOptions
_This are the info options that can be passed as a parameter in `video_info` and `video_basic_info`_
- cookie : **[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.**
- proxy : Optional parameter to add support of proxies. As of now, HTTPS proxies are only supported. So make sure to get HTTPS proxies only.
```js
const video = await video_basic_info(url, { cookie : "cookies" }) // Gives cookies support
const video = await video_basic_info(url, { proxy : ['url'] }) // Accepts a url which has port in in it.
const video = await video_basic_info(url. {proxy : [{
host : "IP or hostname",
port : 8080
}]
}) // Or add a json containing hostname and port.
```
### video_basic_info(url : `string`, options? : [`InfoOptions`]())
_The basic video details `play-dl` fetches at first from url or videoID._ _The basic video details `play-dl` fetches at first from url or videoID._
**[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.**
```js ```js
const video = await video_basic_info(url) const video = await video_basic_info(url)
``` ```
### video_info(url : `string`, cookie? : `string`) ### video_info(url : `string`, , options? : [`InfoOptions`]())
_This contains everything with deciphered formats along with `video_details`. It can fetech data from url or videoID._ _This contains everything with deciphered formats along with `video_details`. It can fetech data from url or videoID._
**[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.**
```js ```js
const video = await video_info(url) const video = await video_info(url)
``` ```
@ -74,18 +89,18 @@ const video = await video_info(url)
## Playlist ## Playlist
### playlist_info(url : `string`, parseIncomplete : `boolean`) ### playlist_info(url : `string`, options : `PlaylistOptions`)
_This fetches all details about a playlist from a url or playlistID._ _This fetches all details about a playlist from a url or playlistID._
**parseIncomplete** is optional parameter if you want to parse playlist with hidden videos.
```js ```js
const playlist = await playlist_info(url) const playlist = await playlist_info(url)
//This only fetches first 100 videos from a playlist //This only fetches first 100 videos from a playlist
const playlist = await playlist_info(url, true) const playlist = await playlist_info(url, { incomplete : true })
//This only fetches first 100 videos from a playlist and also parses playlist with hidden videos //This only fetches first 100 videos from a playlist and also parses playlist with hidden videos
const playlist = await playlist_info(url, { proxy : [''] }) // Same 2 options as mentioned in InfoOptions
``` ```
- #### fetch() `method` - #### fetch() `method`