Merge pull request #30 from play-dl/developer

Validation methods added
This commit is contained in:
Killer069
2021-08-31 10:17:44 +05:30
committed by GitHub
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`)