ReadMe updated
This commit is contained in:
parent
d8ba1f1b9e
commit
b91cfdcf00
19
README.md
19
README.md
@ -32,22 +32,25 @@ const options = {
|
|||||||
const results = await youtube.search('post malone sunflower', options);
|
const results = await youtube.search('post malone sunflower', options);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Validate
|
||||||
|
### validate( url : `string` )
|
||||||
|
*Much faster and easier way to validate url.*
|
||||||
|
```js
|
||||||
|
if(validate(url)) // Will return true if url is a YouTube url
|
||||||
|
```
|
||||||
|
|
||||||
# Stream
|
# Stream
|
||||||
|
|
||||||
### stream(url : `string`, error_check? : `boolean`)
|
### stream(url : `string`)
|
||||||
*This is basic to create a youtube stream from a url.*
|
*This is basic to create a youtube stream from a url.*
|
||||||
```js
|
```js
|
||||||
let source = await stream(<url>) // This will create a stream Class which contains type and stream to be played.
|
let source = await stream(<url>) // This will create a stream Class which contains type and stream to be played.
|
||||||
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
|
||||||
|
|
||||||
let source = await stream(<url>, true) //This will check for 404 error if any
|
|
||||||
```
|
```
|
||||||
 `Note : enabling error_check will take more time to start streaming`
|
|
||||||
|
|
||||||
|
### stream_from_info(info : `infoData`)
|
||||||
### stream_from_info(info : `infoData`, error_check? : `boolean`)
|
|
||||||
*This is basic to create a youtube stream from a info [ from video_info function ].*
|
*This is basic to create a youtube stream from a info [ from video_info function ].*
|
||||||
```js
|
```js
|
||||||
let info = await video_info(<url>)
|
let info = await video_info(<url>)
|
||||||
@ -55,11 +58,7 @@ let info = await video_info(<url>)
|
|||||||
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
|
||||||
|
|
||||||
let source = await stream_from_info(info, true) //This will check for 404 error if any
|
|
||||||
```
|
```
|
||||||
 `Note : enabling error_check will take more time to start streaming`
|
|
||||||
|
|
||||||
|
|
||||||
# Search
|
# Search
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user