Files
play-dl-test/play-dl/token.ts

25 lines
655 B
TypeScript
Raw Normal View History

2021-10-12 14:09:14 +05:30
import { setSoundCloudToken } from './SoundCloud';
import { setSpotifyToken } from './Spotify';
import { setCookieToken } from './YouTube/utils/cookie';
2021-10-12 13:56:33 +05:30
interface tokenOptions {
2021-10-12 14:09:14 +05:30
spotify?: {
client_id: string;
client_secret: string;
refresh_token: string;
market: string;
};
soundcloud?: {
client_id: string;
};
youtube?: {
cookie: string;
};
2021-10-12 13:56:33 +05:30
}
2021-10-12 14:09:14 +05:30
export function setToken(options: tokenOptions) {
if (options.spotify) setSpotifyToken(options.spotify);
if (options.soundcloud) setSoundCloudToken(options.soundcloud);
if (options.youtube) setCookieToken(options.youtube);
}