mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-06 04:32:40 +00:00
Docs and examples updated
This commit is contained in:
99
docs/SoundCloud/README.md
Normal file
99
docs/SoundCloud/README.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# SoundCloud
|
||||
|
||||
## Main
|
||||
|
||||
### soundcloud(url : `string`)
|
||||
|
||||
_This returns data from a track | playlist url._
|
||||
|
||||
```js
|
||||
let data = await soundcloud(url) //Gets the data
|
||||
|
||||
console.log(data.type) // Console logs the type of data that you got.
|
||||
```
|
||||
|
||||
## Validate
|
||||
|
||||
### so_validate(url : `string`)
|
||||
|
||||
_This checks that given url is soundcloud url or not._
|
||||
|
||||
**Returns :** `track` | `playlist` | `false`
|
||||
|
||||
```js
|
||||
let check = await so_validate(url)
|
||||
|
||||
if(!check) // Invalid SoundCloud URL
|
||||
|
||||
if(check === 'track') // SoundCloud Track URL
|
||||
```
|
||||
|
||||
## Classes [ Returned by soundcloud() function ]
|
||||
|
||||
### SoundCloudTrack
|
||||
|
||||
_This is class for a soundcloud track._
|
||||
|
||||
##### type `property`
|
||||
|
||||
_This will always return as "track" for this class._
|
||||
|
||||
##### toJSON() `function`
|
||||
|
||||
_converts class into a json format_
|
||||
|
||||
### SoundCloudPlaylist
|
||||
|
||||
_This is a soundcloud playlist class._
|
||||
|
||||
##### fetch() `function`
|
||||
|
||||
_This will fetch tracks in a playlist._
|
||||
|
||||
```js
|
||||
let data = await soundcloud(playlist_url)
|
||||
|
||||
await data.fetch() // Fetches all unfetched tracks in playlist
|
||||
```
|
||||
|
||||
##### tracksCount `property`
|
||||
|
||||
_This will give no. of tracks in a playlist._
|
||||
|
||||
```js
|
||||
let data = await soundcloud(playlist_url)
|
||||
|
||||
console.log(data.tracksCount) // Returns total tracks count in a playlist
|
||||
```
|
||||
|
||||
#### tracks `property`
|
||||
|
||||
_This will give all tracks fetched as array._
|
||||
|
||||
```js
|
||||
let data = await soundcloud(playlist_url)
|
||||
|
||||
console.log(data.tracks) // Tracks Array
|
||||
|
||||
data.tracks.forEach((track) => {
|
||||
queue.push(track) // This will push every track in playlist to your queue
|
||||
})
|
||||
```
|
||||
|
||||
#### total_tracks `property`
|
||||
|
||||
_This give total videos that have been fetched so far._
|
||||
|
||||
```js
|
||||
let data = await soundcloud(playlist_url)
|
||||
|
||||
console.log(data.total_tracks) // This will tell no. of videos that have been fetched so far.
|
||||
```
|
||||
|
||||
##### type `property`
|
||||
|
||||
_This will always return as "playlist" for this class._
|
||||
|
||||
##### toJSON() `function`
|
||||
|
||||
_converts class into a json format_
|
||||
Reference in New Issue
Block a user