mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Fixed find chapter error, soundcloud 403 and watch playlists
This commit is contained in:
@@ -111,10 +111,14 @@ export async function stream(url: string, quality?: number): Promise<SoundCloudS
|
||||
* @returns client ID
|
||||
*/
|
||||
export async function getFreeClientID(): Promise<string> {
|
||||
const data = await request('https://soundcloud.com/');
|
||||
const data: any = await request('https://soundcloud.com/', {headers: {}}).catch(err => err);
|
||||
|
||||
if (data instanceof Error)
|
||||
throw new Error("Failed to get response from soundcloud.com: " + data.message);
|
||||
|
||||
const splitted = data.split('<script crossorigin src="');
|
||||
const urls: string[] = [];
|
||||
splitted.forEach((r) => {
|
||||
splitted.forEach((r: string) => {
|
||||
if (r.startsWith('https')) {
|
||||
urls.push(r.split('"')[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user