Docs + search validate updated

This commit is contained in:
killer069
2021-10-09 18:59:16 +05:30
parent 6698a87983
commit f6a91254aa
6 changed files with 37 additions and 38 deletions

View File

@@ -12,7 +12,7 @@ For source specific commands :-
_This checks all type of urls that are supported by play-dl._
**Returns :** `so_playlist` | `so_track` | `sp_track` | `sp_album` | `sp_playlist` | `yt_video` | `yt_playlist` | `false`
**Returns :** `so_playlist` | `so_track` | `sp_track` | `sp_album` | `sp_playlist` | `yt_video` | `yt_playlist` | `search` | `false`
`so` = **SoundCloud**
@@ -30,6 +30,8 @@ if(check === 'yt_video') // YouTube Video
if(check === 'sp_track') // Spotify Track
if(check === 'so_track') // SoundCloud Track
if(check === "search") // Given term is not a url. Search this term somewhere.
```
### authorization()

View File

@@ -18,7 +18,7 @@ console.log(data.type) // Console logs the type of data that you got.
_This checks that given url is soundcloud url or not._
**Returns :** `track` | `playlist` | `false`
**Returns :** `track` | `playlist` | `search` | `false`
```js
let check = await so_validate(url)
@@ -26,6 +26,8 @@ let check = await so_validate(url)
if(!check) // Invalid SoundCloud URL
if(check === 'track') // SoundCloud Track URL
if(check === "search") // Given term is not a SoundCloud URL. Search this somewhere.
```
## Classes [ Returned by `soundcloud(url)` function ]

View File

@@ -12,6 +12,25 @@ let data = await spotify(url) //Gets the data
console.log(data.type) // Console logs the type of data that you got.
```
## Validate
### sp_validate(url : `string`)
_This checks that given url is spotify url or not._
**Returns :** `track` | `album` | `playlist` | `search` | `false`
```js
let check = sp_validate(url)
if(!check) // Invalid Spotify URL
if(check === 'track') // Spotify Track URL
if(check === "search") // Given term is a spotify url. Search it somewhere.
```
### is_expired()
_This tells that whether the access token is expired or not_
@@ -183,19 +202,3 @@ _This will always return as "album" for this class._
##### toJSON() `function`
_converts class into a json format_
## Validate
### sp_validate(url : `string`)
_This checks that given url is spotify url or not._
**Returns :** `track` | `album` | `playlist` | `false`
```js
let check = sp_validate(url)
if(!check) // Invalid Spotify URL
if(check === 'track') // Spotify Track URL
```

View File

@@ -17,7 +17,7 @@ const results = await youtube.search('post malone sunflower', options);
_This will validate url and return type or boolean_
**Returns :** `video` | `playlist` | `false`
**Returns :** `video` | `playlist` | `search` | `false`
```js
let check = yt_validate(url)
@@ -27,6 +27,8 @@ if(!check) // Invalid URL
if(check === "video") //URL is video url
if(check === "playlist") //URL is a playlist url
if(check === "search") // Given term is not a video ID and PlayList ID.
```
## Extract ID