2021-09-21 13:00:38 +05:30
..
2021-09-21 13:00:38 +05:30

SoundCloud

Main

soundcloud(url : string)

This returns data from a track | playlist url.

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

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.

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.

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.

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.

    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