More Validation methods added

This commit is contained in:
killer069
2021-08-31 10:16:14 +05:30
parent 201865af09
commit 382447f397
6 changed files with 27 additions and 5 deletions

View File

@@ -33,12 +33,24 @@ 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
```
### validate_playlist( url : `string` )
*Much faster and easier way to validate url.*
```js
if(validate_playlist(url)) // Will return true if url is a YouTube Playlist url
```
> Want to Check both, use this
```js
if(validate(url) || validate_playlist(url)) // This will check both and if anyone is true, it will execute the below function
```
# Stream
### stream(url : `string`)