diff --git a/docs/SoundCloud/README.md b/docs/SoundCloud/README.md index 6b2b2bf..61522ec 100644 --- a/docs/SoundCloud/README.md +++ b/docs/SoundCloud/README.md @@ -12,6 +12,20 @@ let data = await soundcloud(url) //Gets the data console.log(data.type) // Console logs the type of data that you got. ``` +### getFreeClientID() + +_This returns free client ID._ + +```js +const client_id = await getFreeClientID() + +setToken({ + soundcloud : { + client_id : client_id + } +}) // This will set client ID for use in play-dl. +``` + ## Validate ### so_validate(url : `string`) diff --git a/play-dl/SoundCloud/index.ts b/play-dl/SoundCloud/index.ts index 9c37e49..384dc15 100644 --- a/play-dl/SoundCloud/index.ts +++ b/play-dl/SoundCloud/index.ts @@ -85,6 +85,23 @@ export async function stream(url: string, quality?: number): Promise { : StreamType.Arbitrary; return new Stream(s_data.url, type); } +/** + * Function to get Free Client ID of soundcloud. + * @returns client ID + */ +export async function getFreeClientID(): Promise{ + const data = await request('https://soundcloud.com/') + const splitted = data.split('