mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-06 04:32:40 +00:00
soundcloud free client ID
This commit is contained in:
@@ -85,6 +85,23 @@ export async function stream(url: string, quality?: number): Promise<Stream> {
|
||||
: 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<string>{
|
||||
const data = await request('https://soundcloud.com/')
|
||||
const splitted = data.split('<script crossorigin src="')
|
||||
const urls: string[] = []
|
||||
splitted.forEach((r) => {
|
||||
if(r.startsWith('https')) {
|
||||
urls.push(r.split('"')[0])
|
||||
}
|
||||
})
|
||||
const data2 = await request(urls[urls.length - 1])
|
||||
return data2.split(',client_id:"')[1].split('"')[0]
|
||||
}
|
||||
|
||||
/**
|
||||
* Type for SoundCloud Stream
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user