code made prettier

This commit is contained in:
killer069 2021-10-20 19:10:15 +05:30
parent 3416cd493f
commit 5d1b5af75a
3 changed files with 12 additions and 19 deletions

View File

@ -89,17 +89,17 @@ export async function stream(url: string, quality?: number): Promise<Stream> {
* 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[] = []
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])
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]
});
const data2 = await request(urls[urls.length - 1]);
return data2.split(',client_id:"')[1].split('"')[0];
}
/**

View File

@ -148,7 +148,7 @@ export class SpotifyPlaylist {
if (typeof response !== 'string') return;
const json_data = JSON.parse(response);
json_data.items.forEach((v: any) => {
if(v.track) videos.push(new SpotifyTrack(v.track));
if (v.track) videos.push(new SpotifyTrack(v.track));
});
this.fetched_tracks.set(`${i}`, videos);
resolve('Success');
@ -254,7 +254,7 @@ export class SpotifyAlbum {
if (typeof response !== 'string') return;
const json_data = JSON.parse(response);
json_data.items.forEach((v: any) => {
if(v) videos.push(new SpotifyTrack(v));
if (v) videos.push(new SpotifyTrack(v));
});
this.fetched_tracks.set(`${i}`, videos);
resolve('Success');

View File

@ -1,8 +1 @@
export {
video_basic_info,
video_info,
decipher_info,
playlist_info,
yt_validate,
extractID
} from './extractor';
export { video_basic_info, video_info, decipher_info, playlist_info, yt_validate, extractID } from './extractor';